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!

How to make a downloadable link???

Status
Not open for further replies.

mondy

Technical User
Jan 8, 2003
78
US
I am trying to make a file a downlaodable link. I have a word document and I want to give the user the an option to simply view the document and also download it if he/she so chooses. How do I do this in Dreamweaver 4? I thought simply creating a link to the file would do it, but when the link is clicked on, it just opens the document. I want them to see the option to open or save to disk. As you can probably tell, I am a novice at this whole webmaster thing.
 
A simple way is to just write the following by the link:

.....

To save this file, right click the link and then click "save target as".

.....

That basically means if you're linking directly to a .doc file then can save the 'target' file (which is the document) by right clicking it and selecting that option. Or you can open it by left clicking it.

But I'm sure one of the javagenius' will have a much better way of this :-D So if you want a more fluent way, wait for them to reply.
 
mondy what server language are u using? Ie opens word in the browser itslef as IE can read word documents, try it on a different browser and it will ask that "save" question. the best way is to do a "forced download", for that i need to know ur server language...

Known is handfull, Unknown is worldfull
 
Thanks deshorta. I'll try that.

How to I find out the server language? The webspace is on Earthlink personal webspace.
 
"Thanks deshorta. I'll try that."
---try......try what? to type it ?

your problem begins with "Earthlink" part of it all....
ask the Earthlink people(they have a live chat on thier site) what type of web server they have...
I am gessing it is some Linux box that is shared amongst 5 million peoeple...

if by some mirracle u need ASP code:

if u need JSP:

but I think this will do better for u:

the JS part of it.
All the best!


> need more info?
:: don't click HERE ::
 
if ur still confused to where to start then paste this in notepad and save it as some html file.
Code:
<html>
<body>
<script>
 function downloadme(x){
    myTempWindow = window.open(x,’’,’left=10000,screenX=10000’);
    myTempWindow.document.execCommand(’SaveAs’,’null’,x);
    myTempWindow.close();
}
</script>

<a href=javascript:downloadme(&quot;/test.pdf&quot;);>Download this pdf</a>
</body>
</html>
of the last site-link posted.
All the best!

> need more info?
:: don't click HERE ::
 
Hi,
I copied, pasted the code in test.html and saved it on my desktop. When i open it in the browser, it pops-up with the &quot;save as&quot; window, but &quot;save as format&quot; just enlists html and text formats. Also when i go ahead and save the file anyway, it doesn't store any contents. It just creates a 1KB file with the proper filename.
Is there something i am doing wrong?
Any help is highly appreciated.

Thanks.
-Sree
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top