kristian_gjengedal Posted December 18, 2007 Report Share Posted December 18, 2007 i have a problem, when i try to download .msi files or .wpl files from my uniformserver 3.5, they gets opened in the browser instead as tekst files, isthere a way to get them to download instead of being opened as tekst files? ps. sorry if this is the wrong topic. Quote Link to comment Share on other sites More sharing options...
Ric Posted December 19, 2007 Report Share Posted December 19, 2007 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 bestRic Quote Link to comment Share on other sites More sharing options...
Ric Posted August 4, 2008 Report Share Posted August 4, 2008 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 bestRic Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.