Can anyone tell me if it is possible to add a download attribute to force a pdf to download rather than open in a browser window? I can't find anywhere to do this and I don't want the files opening in the browser as they don't display correctly.
Can anyone tell me if it is possible to add a download attribute to force a pdf to download rather than open in a browser window? I can't find anywhere to do this and I don't want the files opening in the browser as they don't display correctly.
Hi Frank,
There is no option to control that attribute and usually it depends on the user's browser how it will handle the PDF link.
You can only add the whole link manually with the code using the HTML control to add the desired attribute.
...................................................
Sincerely,
Hella
Nicepage Support Team
Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp
Thanks for your response. Guess I'll have to manually code the element.
Hi Frank,
You are welcome. Feel free to contact us on any occasion.
...................................................
Sincerely,
Hella
Nicepage Support Team
Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp
I think it is somewhat easier to set the content disposition header of your web page. If your web page is hosted on an Apache web server, you can do it in a simple way. Let's say you would like any PDF file to be automatically downloaded from the web site instead of being displayed. Then, you have to create a file named '.htaccess', and write the following lines to the file:
<FilesMatch ".(pdf)$">
Header set Content-Disposition attachment
If you want more than one file type to be downloaded, then write this:
<FilesMatch ".(pdf|docx|zip)$">
Header set Content-Disposition attachment
If you want just a certain file to be downloaded, add the following lines to the .htaccess file:
<Files "example.pdf">
Header set Content-Disposition attachment
And upload the .htaccess file to the root directory, commonly the public_html folder, or any folder whose properties you want to modify.
Peter