Force pdf-file to not open in browser
-
Hi
I’m trying to achieve that the pdf-files of my website are directly downloaded and never opened in the browser.
I already achieved that the pdf-file is downloaded but it’s still opened simultaneously in firefox. In chrome it’s not opened simultaneously but as soon as I click on the file in the “download bar” of the browser it is opened in the browser too.I achieved the forced download with the following code in the .htaccess-file:
# Force file download <FilesMatch "\.(pdf)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch> # END AddType application/octet-stream .pdf
Is there a way to force that the pdf-file has to be opened in the system viewer?
Thank you for your help.
Best regards
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Force pdf-file to not open in browser’ is closed to new replies.