PDF file is damaged
Hello,
When PDF files are downloaded, the user receives the following error:
"There was an error opening this document. The file is damaged and could not be repaired".
This error occurs with older versions of Adobe Acrobat Reader (tested and failed on 6.0, 7.0). The code I am using is pasted below and is a collaboration of research I've done on EE and google.
Note: The file that is streamed to the user has a higher file size than the actual file. You can see below I have tried using different headers, pdf and octet-stream.
We must maintain the ability of allowing the client to download the pdf file rather than it opening in the browser.
Any help is appreciated.
Thanks.
|