Download PDF to Chrome from TCPDF

When you load a PDF file in Chrome 12.0.742.91 (either as an attachment or as a string), the download is interrupted (at first it shows 125 KB, but later 127518/0 V, and then it stops completely).

File upload works correctly in Firefox and IE. The headers are correct, apache returns 200 OK . Previously, everything was fine, probably before the Chrome update a few days ago.

+6
source share
3 answers

For additional reference only: the problem is with gzip processing. Disabling transparent gzip compression solved it.

+2
source

Check the Content-Length header. It seems to return a size smaller than the file itself. I suspect Chrome is aborting the download because it receives more bytes than it should. It would be easy to set up a test case for this.

+1
source

I had problems when the file name contained strange characters, such as some accents (é é ó ó ú) or this degree symbol: º.

0
source

Source: https://habr.com/ru/post/890281/


All Articles