homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
Forum Library, Charter, Moderators: not2easy

Site Graphics and Multimedia Design Forum


 3:09 am on Apr 23, 2004 (gmt 0)

I want let user click on a button 'Download' to download a picture (saved in a floder or...)then they will see the download menu as what we always see when we donwload some application from website. Can I do it? Can anyone show me the way? Or where can I get these information, example?



 11:08 pm on Apr 25, 2004 (gmt 0)

You can simply put a link to the file on your web page. The problem you will find is that many picture formats are set to default (by a particular user) to open in a program. For instance if I click on a link to test.gif it will open in the Microsoft Picture Viewer and not provide me with the download option.

The way to override this is to zip your image; for example test.zip. Then you you create a link to test.gif and you will be presented with the download window.

PS. You can always right click and choose save as on any link and in effect download the file, but that is not what you asked for.


 12:01 am on Apr 26, 2004 (gmt 0)

Yes you can do this. In the HTTP protocol there is a feature known as Content-Disposition, it allows the web server to suggest to the browser that the file should be saved instead of being displayed in the browser. It also allows the web server to suggest an alternate filename for the file to be saved as.

See [w3.org...] for technical details about Content-Disposition.

Now the hard part is getting the webserver to include this header. The easiest way to do it is via a script such as PHP, Perl or ASP. If you search for Content-Disposition and one of these scripting language you should come across some examples of how to do it.


 12:42 am on Apr 26, 2004 (gmt 0)

The short answer is yes. You can force a document to download. We use a PHP script to force a document to download.

Although, we've found it's best to just use a file format that will automatically go to download such as .zip, .pdf, or .doc files. If you force a document to download that would normally just appear in the browser, such as a JPG, people tend not to know how to open it later. And, if they are smart enough to know where to find it after they've downloaded it, and smart enough to know how to select the right program to open it, then they are smart enough to know to right-click on it and save it. IMHO.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Site Graphics and Multimedia Design
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved