English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to let people download files (like pics, text documents, etc.) that I have uploaded. What is the HTML code that I need to use to be able to do this?

2007-12-01 12:20:03 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

I want to the user to do what the first answerer said, except I just want the person to (left) click the link, and it do the same as it would do as if the viewer had right clicked, and "Saved Target As"

2007-12-01 12:40:14 · update #1

6 answers

You don't need to enable downloads of files like these.

Because of embedded mime types the server and the browsers know how to treat certain extensions.

Just store the .exe file and when you reference the link, the browser will open a file save dialogue box.

Same as for any file extension.

Just reference it like http://www.server.com/picture.jpg or

http://www.server.com/zip.exe

As long as you store the jpg or exe on the root folder.

If it's not stored there, provide the full path.

Good Luck.

2007-12-01 12:24:50 · answer #1 · answered by Someone Else 5 · 0 0

If you want to *let* them do it, just tell them how to right click and do it. If you want to *force* a download, I think you will need to resort to scripting; I don't know of any HTML that will do that. Google "force download" for some ideas. One alternative tactic is to put the content in a zip file. You might also be able to do it via ftp if you're set up for anonymous ftp; I'm not sure whether all browsers will treat that as a download, though.

2007-12-01 13:10:21 · answer #2 · answered by injanier 7 · 0 0

link to download
Tell them to right click the link to download and choose Save Target As.. this will allow them to save the file. For every time of file you can use this, .txt, .jpg, .pdf, .gif, whatever. :)

--Edit

Unless the file is an EXE or a ZIP/RAR extension which is required to automatically download instead of open on your browser, it would not work. If you Zip/Rar all your files, it would work exactly the way you want because IE won't open these file extensions, they will automatically download.

2007-12-01 12:24:01 · answer #3 · answered by ilan 6 · 0 0

this is possible ..but php or other web programming language is required i think..i don't know if a javascript can do this..google it

anyway, take a look at this php script... this is how i did for my website.

http://www.codewalkers.com/c/a/File-Manipulation-Code/Universal-downloader/

2007-12-01 13:00:46 · answer #4 · answered by NOoE 3 · 0 0

You can also hold CTRL while clicking....just an option.
The first answer above is what you are looking for.

2007-12-01 12:25:22 · answer #5 · answered by KeWr 5 · 0 0

this might work for you
target="_self">Name_File

2007-12-01 12:24:41 · answer #6 · answered by Anonymous · 0 0

fedest.com, questions and answers