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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button to download pdf???

Status
Not open for further replies.

LittleNFiesty

Technical User
Sep 26, 2006
46
US
I want to put a button on my page so when you click on it it downloads a pdf to their computer. But I can't figure out how to do it. HELP!!

P.S. Using DW CS4
 
A Button? As opposed to a link?

Code:
<a href="[URL unfurl="true"]http://www.servername.com/path/to/file.pdf">Download[/URL] PDF</a>
If not that, then how about:
Code:
<input type=button value="Download PDF" onclick="document.location='[URL unfurl="true"]http://www.servername.com/path/to/file.pdf'">[/URL]



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
For which one:
For the link you give it a target:

Code:
<a href="[URL unfurl="true"]http://www.servername.com/path/to/file.pdf"[/URL] target="_blank">Download PDF</a>

For the button its slightly more complex, as you need a different function:

Code:
<input type=button value="Download PDF" onclick="window.open('[URL unfurl="true"]http://www.servername.com/path/to/file.pdf')">[/URL]


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I want to make able people to download a pdf file. How can I do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top