This subject was introduced in development support - I think I can migrate it to here....
I want to be able to force a file download for an image file as opposed to it opening in a browser window.
I'm tackling this from several directions and so far....
configure an .htaccess file on linux servers. Works great with firefox, however IE still wants to view the file.
Have a copy of the image zipped and in another directory. Definately works, however causes a lot of work if manually dealing with a lot of files and complicates things with the file upload if trying to automate the process... that is being looked at!
Have it coded within the script that is referring to the file... trouble is it is an external script ... the basics are someone wants a file, they click on a link that takes them to a payment gateway - in this case it's a mobile phone service provider, once a text has been sent they are refered to the directory where that file is held.
I have contacted the company to see if anything can be done there end, however in the meantime I have also come across this:
http://support.microsoft.com/kb/q260519/
hence the reason for this post!
How To Raise a "File Download" Dialog Box for a Known MIME Type
To apply the header dynamically, create an Active Server Pages (ASP) file that writes the document out to the browser. Use the Response.AddHeader method to add the content-disposition header. For example:
Response.AddHeader "content-disposition","attachment; filename=fname.ext"
Can this be added to the directory - like an .htaccess file to force a download for all the images in that directory, if so how?
Finally,on running through Helm, there is a MIME types link which allows you to customise MIME types. Can I change this so that .jpg files are downloaded from the server for that particular domain? If that is the case I am assuming that all 'image' files embeded in the web pages would then have to be gifs and pngs otherwise it that was possible you'd get dialog boxes for those as well![]()


Reply With Quote

Bookmarks