Google-chrome – How to instruct Chrome to download PDF rather than (pre)view in browser

downloadgoogle-chromepdf

I have PDF file for download by users on my website.

Is there a way to instruct Chrome not to view the PDF in the users browser when the user clicks the link to the PDF, but instead download the PDF to the users download folder instead? Or at least instruct Chrome to ask the user whether he wants to view the PDF in the browser or download it (rather than just viewing in browser automatically) ?

Thanks 🙂

Best Answer

You could use the download property in your link (anchor) like so:

<a href="some/path/somefile.pdf" download target="_blank">download PDF file</a>

This would force download in the browsers, which support it (Chrome, Firefox and Opera). However, it is not currently supported in IE or Safari as per this link

Source: https://stackoverflow.com/questions/3802510/force-to-open-save-as-popup-open-at-text-link-click-for-pdf-in-html

Related Question