Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download PDF in Chrome from TCPDF

When a downloading PDF file in Chrome 12.0.742.91 (either as an attachment and inline), the download is interrupted (at the beginning it shows 125KB, but later 127518/0 B and then it stops entirely).

The file download works correctly in Firefox and IE. Headers are correct, apache returns 200 OK. Previously, everything was ok, probably until a Chrome update a few days ago.

like image 262
Dominik Avatar asked Jun 11 '11 10:06

Dominik


2 Answers

Just for further reference: The problem is related to the gzip handling. Disabling transparent gzip compression solved it.

like image 171
phihag Avatar answered Nov 11 '22 06:11

phihag


Check your Content-Length header. It seems to be returning a size smaller than the file itself. I suspect Chrome is interrupting the download as its receiving more bytes than it should. It would be easy to put a test case in place for this however.

like image 1
datasage Avatar answered Nov 11 '22 05:11

datasage