View Full Version : How to download
I'm new to html and want visitors to be able to download a file from my site. From looking at other site's code it looks very simple to implement. However I have the following in my html code...
<a href="\directory\filename.exe">Download file</a>
but it doesn't work. The path and file name ARE correct. Should I chmod the file or something? I can't find any reference in my tutorials. Any help would be appreciated.
Regards
Gary Finlay
paulselhi
12-15-02, 03:08 PM
and they should be able to right click and "save as"
Remove the first "/".
The first "/" tells apache to start looking for "directory" in your home directory, NOT your htdocs.
ie: <a href="directory\filename.exe">Download file</a>
Here is the actual line from my code...
<a href="download\filename.exe">Download file</a>
and here is the error I'm getting when I click on it...
Not Found
The requested URL /download/filename.exe was not found on this server.
notice how the error has a slash in front of download/filename.exe whereas my code doesn't
Any further help appreciated.
Regards
Gary Finlay
UNIX is case sensitive. Your file is FILE.EXE, not file.exe.
I should have added that the folder "directory" is a sub-folder of "htdocs"
Regards
Gary Finlay
BINGO! It worked. Renamed the file using lowercase and its working fine now. Many thanks.
Regards
Gary Finlay (another lesson learned)
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.