Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PDF download

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

I am trying to let users download a pdf from my site. How do you make sure that they download it, and stop it loading into the browser view, and force them to save it to their computer?

Does anyone have any ideas?

thanks in advance

Lewis
 
There are a few work arounds such as execommand(save as) for IE, but they only way to make it work for all browsers, is to use a server-side language (such as ASP), and send out false headers to fool the browser into downloading it instead of opening it. Regards

Big Bad Dave

davidbyng@hotmail.com
 
hey Dave, post here an example.. you've already wrote this, i guess guys out there are curious Victor
 
LewisNorth

What you can do is have the .pdf file on your webspace then create a link to it.
eg.
<A HREF=&quot;filename.pdf&quot;>HOLD SHIFT AND CLICK THIS LINK TO SAVE .PDF FILE</A>

On windows based platforms users can hold down shift while they click on a link and can save basically any file that way. As long as you let people know to hold shift when they click, the .pdf file will not open, but a save box will open so they can save it.

This is a basic and simple way of doing it.
Hope it helps!

0598792469
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top