Forums
This topic is locked
Creating a download link for a text file
Posted 23 Dec 2005 22:15:36
1
has voted
23 Dec 2005 22:15:36 Chris Shane posted:
Newbie alert!!!!! <img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>Greetings all <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
I'm beginning to find my way around Dreamweaver MX but am working in design view and not code.
I am creating a small site for myself and wish to add a download link. What I have is a txt file that I have placed on my server. I want to link to it in such a way that should a visitor click it the download window will pop up and prompt the visitor to begin the download to a location of their choosing.
The problem is I cant find a way of doing this. At the all I have is a hyperlink and the only way to DL the file is via right click/save target as which isnt what I want.
Any help greatly appreciated <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replies
Replied 28 Dec 2005 06:21:30
28 Dec 2005 06:21:30 Jeremy Conn replied:
You could zip it using WinZip - then they will be given the "Save or Open" dialog prompt.
<b>Jeremy Conn</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | Access/SQL2000
<b>Jeremy Conn</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | Access/SQL2000
Replied 29 Dec 2005 01:13:44
29 Dec 2005 01:13:44 Jamie Nicol replied:
I dunno about Dreamweaver; this is an http/server thing.
In PHP you would do something like this:
header("Content-Type: text/plain"
header("Content-Disposition: attachment; filename=the_files_name.txt"
... then read and spit out the file's data.
Another way to do it is to put the file in a folder, and set up the HTTP headers for that folder in Apache or IIS.
The headers required are exactly the same as those above, except for the filename=xxx bit.
In PHP you would do something like this:
header("Content-Type: text/plain"
header("Content-Disposition: attachment; filename=the_files_name.txt"
... then read and spit out the file's data.
Another way to do it is to put the file in a folder, and set up the HTTP headers for that folder in Apache or IIS.
The headers required are exactly the same as those above, except for the filename=xxx bit.