Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Safari users report problems downloading pdf files

Recently, Safari users (Mac, ipad, iphone) have not been able to download or view pdf files generated for them by my site. This always worked before with Safari, but I don't know when the problem started. Chrome, Edge, Brave, and Firefox all work fine, but Safari gives the error: [Safari cannot open the page. The error was: "cannot parse response".] My customers use a Mac or iPad, but I verified the problem via an iphone running IOS 14.4. I have searched the web for answers and have tried deleting cached files and cookies and even disabling experimental Safari features one-by-one. So far, nothing helps. I currently tell people to use Chrome, Brave, Firefox, or Edge, but I would rather not have to do that. Any insights will be appreciated.

Posted on Feb 21, 2021 11:54 AM

Reply
Question marked as Best reply

Posted on Feb 27, 2021 8:08 AM

OK. This obscure problem is fixed, but to help others I wanted to explain it. Our website pdf generator puts a file size in the header assuming compression is disabled (which it always was). However, our web host recently switched to ngnix to stream out files, and that process uses compression. Therefore, the content-length header information was incorrect (30kb instead of 28 kb compressed). Safari just crashed due to this file-size mismatch, and Firefox sometimes choked as well. However, Chrome, Brave, and Edge all seem to understand this issue and correct for it behind the scenes. Anyway, the solution to keep Safari and Firefox happy was simply to remove the content-length header.

1 reply
Question marked as Best reply

Feb 27, 2021 8:08 AM in response to jwbapple

OK. This obscure problem is fixed, but to help others I wanted to explain it. Our website pdf generator puts a file size in the header assuming compression is disabled (which it always was). However, our web host recently switched to ngnix to stream out files, and that process uses compression. Therefore, the content-length header information was incorrect (30kb instead of 28 kb compressed). Safari just crashed due to this file-size mismatch, and Firefox sometimes choked as well. However, Chrome, Brave, and Edge all seem to understand this issue and correct for it behind the scenes. Anyway, the solution to keep Safari and Firefox happy was simply to remove the content-length header.

Safari users report problems downloading pdf files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.