• I want to create a link on my page for an automatic download of a PDF file. I know I can use the download attribute but that is not cross-browser yet. Everything I’ve tried just links to the media attachment page and then the user would have to download from there. I prefer to save them that step and make it more seamless for them. Is there currently a cross-browser way to achieve this?

Viewing 1 replies (of 1 total)
  • How about adding this to your .htaccess file:

    # FORCE DOWNLOAD
    <FilesMatch "\.(jpg|pdf)$">
      ForceType application/octet-stream
      Header set Content-Disposition attachment
    </FilesMatch>
Viewing 1 replies (of 1 total)
  • The topic ‘How to trigger cross-browser automatic download of PDF file?’ is closed to new replies.