-
Notifications
You must be signed in to change notification settings - Fork 239
PDF works but Image doesn't #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you enabled compression in your Webserver (Nginx or Apache)? If so, this will create a mismatch with the Content-Length header we set here. But without that header there will be no download progress bar in the browser. |
Also what happens if you use |
Below works as well.
|
You could try to exclude the download URL from the deflate module |
I'll be honest I don't really mind that the progress bar doesn't work unless that content-length header is causing my issue. |
I did go ahead and add the following to my apache config file and uncommented the content-length lines. I restarted apache and had the same problem using send() for PDF and Image files.
So to reiterate, if I comment out the content-length lines, send() and send("filename") in Pdf.php works, send() and send("filename") in Image.php doesn't. |
I've found a rule that allows using the content-length lines. Still not getting any Image with send().
I actually only need the line |
Related:
I may consider removing |
@transcendtient What is your download URL that you use with |
@transcendtient I totally forgot a feature in one of the latest changes. You can suppress
Could you try that? If you find a working setup with |
@transcendtient I'd also like to hear your feedback on a change I made to the README that adresses this issue. See the PR linke above here. |
"If you find a working setup with SetEnvIfNoCase..." "I'd also like to hear your feedback on a change I made to the README" What I'm doing as my workaround: TL;DR I'm working around the issue with saveAs(). |
I was waiting for your feedback before merging. The changes are here: https://github.com/mikehaertl/phpwkhtmltopdf/pull/372/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R265 |
Uh oh!
There was an error while loading. Please reload this page.
Simple as that...
AFTER commenting out the content-length header lines.
This works perfectly.
I've also set $delete = false; in File.php and the temporary file it generates is always deleted whether I try PDF or Image. I was trying to see if the file generated has problems on the server but it was always deleted.
The code code below gives "cannot be displayed because it contains errors" on the webpage.
I've printed out the command it executes and that works fine if I run it from the terminal.
The text was updated successfully, but these errors were encountered: