Print Page | Close Window

force image to download

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23680
Printed Date: 29 March 2026 at 9:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: force image to download
Posted By: RCorr
Subject: force image to download
Date Posted: 05 July 2007 at 9:47pm
Hi,

I am creating an intranet page for my company where they can download images of the company logo and partners’ logos.  Is there a way to force a save dialog box to open up instead of the image opening up in a browser.  My page is in html format so no server-side scripting is use. 

When I search the web all I get are examples in PHP and get the following:

header("Content-Type: application/force-download");  

I experiment this in a META tag:

  <META http-equiv="Content-Type" content="application/force-download">

 but it didn't help.  Does anyone know of a solution?

Thanks in advance,

RCorr





Replies:
Posted By: MortiOli
Date Posted: 11 July 2007 at 1:00pm
Not off the top of my head, but you could ZIP them up, which will force it to download rather than just open.


Posted By: KCWebMonkey
Date Posted: 11 July 2007 at 6:05pm
you could rename it with an un-recognized extension and inform the users to rename it after downloading...


Posted By: MortiOli
Date Posted: 12 July 2007 at 1:26pm

Just found this (not tested though);

http://www.irt.org/script/764.htm - http://www.irt.org/script/764.htm



Posted By: RCorr
Date Posted: 19 July 2007 at 9:25pm
Thanks for all of your suggestions.  I prefer not to change the extension.  I visited the page that MortiOli suggested and read that the script only puts the image into cache and instead of prompting a dialog box as it mentioned on the web site. 

I read the page comments and found that I need to implement the mime header application/octet-stream to be able to force the image to download.  How do I go about adding this to my web page?

Thanks in advance,

RCorr



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net