PDA

View Full Version : How to download


garyf
12-15-02, 02:53 PM
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"

Starr
12-15-02, 03:09 PM
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>

garyf
12-15-02, 03:26 PM
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

Starr
12-15-02, 03:27 PM
UNIX is case sensitive. Your file is FILE.EXE, not file.exe.

garyf
12-15-02, 03:28 PM
I should have added that the folder "directory" is a sub-folder of "htdocs"

Regards
Gary Finlay

garyf
12-15-02, 03:33 PM
BINGO! It worked. Renamed the file using lowercase and its working fine now. Many thanks.

Regards
Gary Finlay (another lesson learned)