Jump to content
The Uniform Server Community

download instead of opening filetypes


Recommended Posts

The following may be of interest I could only simulate your results in Firefox using text files and then only by changing the file extension to either .wpl or .msi, IE6 always does things differently I wont even mention the results.


However using files of the correct format Apache is set-up to server these files along with the correct mime type. A browser determines what should be done with them!


The default installation of Firefox recognises a wpl extension and offers a user to either play the list using Windows Media Player or to save to disk. IE6 on the other hand opens the list in Windows Media Player and plays it.


Firefox recognises an msi extension and offers a user to save it to disk, while IE6 will run it. (Trust Firefox on this one!)


A user can change a browsers default response to these files, (force saving or allow to run) My point; you cannot tinker with Apache Mine types to force a file save.


I think the only way to provide a user with the option of saving these files is to either Zip the file or create a self-extracting archive using something like 7zip.


The above is my understating, open to any other ideas and thoughts on this.


Allthe best

Ric :D

Link to comment
Share on other sites

  • 7 months later...

This really is a pain; the first thing I do in any browser is to change the file associations (.pdf) to give me the option to download and not to open or run the file. :)


My original understanding was incorrect you can force modern browsers to present a user with a choice, either to open or save. :)


The method is to change a page’s Header to Content-Disposition :)


Pop this into an htaccess file to allow a user to view or download all text files


Header add Content-Disposition "Attachment"


Likewise all .msi’s


Header add Content-Disposition "Attachment"


and .wpl’s


Header add Content-Disposition "Attachment"


Or you can force all files to have a specific name for example all text files will have the name fred.txt


Header set Content-Disposition "attachment; filename=fred.txt"


Again a user is offered a choice.


All the best

Ric :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...