how do i get a pdf file link to open the save dialog prompt box, not just open the pfd file in WD7 Premium
Stuart
how do i get a pdf file link to open the save dialog prompt box, not just open the pfd file in WD7 Premium
Stuart
In general, this is a browser setting issue and you don't actually have control over it. I am unaware of an HTML link solution. Perhaps someone else will now of one.
Do a Google search for a PHP script (if on a linux host) that you can use. They are out there. Basically what the script will do is to fool browsers by using a mime type that the browser doesn't recognize and therefore cannot open. The result is that the browser will offer to save the linked file.
Take care, Mike
Add a new blank page you can give it the same name as the PDF file and include the .php extension eg. mypdffile.php
Then place the following code using a placeholder (changing "mypdffile" to the name of your PDF file)
The PDF should be uploaded to your home directory or else you will need to change the file path eg. "index_htm_files/mypdffile.pdf"PHP Code:
<?php
header('Content-disposition: attachment; filename=mypdffile.pdf');
header('Content-type: application/pdf');
readfile('mypdffile.pdf');
?>
Then create a link to the page mypdffile.php
This will force the file to download rather than opening in your browser.
Last edited by jamesd; 28 October 2011 at 09:51 PM.
many thanks, I will give it a go.
Stuart
Bookmarks