Prevent 'garbled text' file downloads via server settings
Thu, Feb 19 2004 at 9:34AM PST • Contributed by: cfoster
Thu, Feb 19 2004 at 9:34AM PST • Contributed by: cfoster
I've been trying for quite some time to fix this problem one software vendor at a time, but then thought the Mac OS X Hints would probably be a good way to get the attention of many software developers all at once.
The problem: When I download a .dmg file from someone's web site, about 25% of the time my browser loads the binary file as text to a window instead of saving the file to disk. The reason this happens is that their web server is not configured properly. The problem has persisted for a long time because the two biggest Mac browser (Safari and IE) disregard the server settings and download the file anyway. You may have experienced a similar problem (even with Safari or IE) when downloading .gz or .sitx files.
So, if you manage a web site, please add the following to your site's .htaccess or httpd.conf file:
[robg adds: I've put this in the OS X Server category, but it obviously applies to anyone running a server on any platform...]
The problem: When I download a .dmg file from someone's web site, about 25% of the time my browser loads the binary file as text to a window instead of saving the file to disk. The reason this happens is that their web server is not configured properly. The problem has persisted for a long time because the two biggest Mac browser (Safari and IE) disregard the server settings and download the file anyway. You may have experienced a similar problem (even with Safari or IE) when downloading .gz or .sitx files.
So, if you manage a web site, please add the following to your site's .htaccess or httpd.conf file:
AddType application/octet-stream .dmg
AddType application/x-gzip .gz
AddType application/x-stuffit .sit
AddType application/x-stuffit .sitx
AddType application/zip .zip
The other way to fix it is to change your server's default type, which would mean all unknown file types would be downloaded (and wouldn't that make a whole lot of sense?).
DefaultType application/octet-stream
Applying one of these fixes avoids the annoying occurrence of having your users' browsers get hung for 5 minutes while they try to render 20MB of binary data as text (and would thus help to improve the overall Mac experience)!
[robg adds: I've put this in the OS X Server category, but it obviously applies to anyone running a server on any platform...]
•
[23,796 views]
