PDF does not load in Chrome

I have included the following page, click here in the expression engine. Only some PDF files will be downloaded in chrome, as shown in the link above, while Firefox users can download all the PDF files on the page. I searched various expression engine forums and followed instructions such as disabling my XSS filter and reloading all of my PDF files. I also run this latest version of EE, and I tried to download the PDF files from the super admin account.

I'm not sure if this is a browser problem or a problem with the expression engine, and has anyone encountered this problem before?

+4
source share
2 answers

It looks like you are delivering them as type application/octet-stream . Then you will want to start by setting them as application/pdf . Add this to your .htaccess (if you do not have access to the Apache configuration or you cannot reload the Apache configuration):

 AddType application/pdf .pdf 
+2
source

This is apparently a common problem with chrome. But since chrome is being updated with HTML5, we can use the new new download attribute!

<a href="http://www.domain.com/painful.pdf">Broken</a>
<a href="http://www.domain.com/painful.pdf" download="notsopainful">Works</a>

+2
source

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


All Articles