Force PDF to download

Real quick, in order to force PDF files to download instead of showing in the browser add this to your .htaccess file


Works reasonably well for me.

(EDIT) Except, then I realized that it doesn't work in my favorite browser, Chrome. So, here is the new code…


For this I had to enable mod_headers and restart apache:


That works for Chrome and all the other browsers on my computer, so, hopefully, that will do the trick.

Leave a Reply

Your email address will not be published.