Joomlatools Support Center

How to force file download (PDF) rather than opening?

I have installed docman on Joomla 3.4.5 on Nginx 1.4.6.

Whenever I select a file to download on the website (PDF, etc) it opens the PDF in the window rather than forcing it to download. I've added the following line to NGINX config for the website, but it doesn't seem to want to force the file to download. Any help would be much appreciated!

location ~* (.*\.pdf) {
    types { application/octet-stream .pdf; }
    default_type application/octet-stream;
}

Answer

Posted 4 years ago by Johan Janssens Staff

Hello Jonathan, great to hear you solved it. The easy way to do this is to set the 'force download all files" in the menu item options to 'yes'. To link to the file directly you set the 'document title links to' setting to 'file download' in the document menu item settings.

If there is anything else do not hesitate to let us know.

There are 2 more comments in this ticket.
Subscribe or login to join the discussion!

Jonathan Coe
15.11.15
Answered

System Information

2.1
n/a
n/a