Autodetect correct MIME type from text/plain content

One of the problems that many Mozilla users experince it that content on the internet are served with the wrong content type. The results in fx WMV files not launched in Windows Media Player but instead shown as text in the browser window. This is due to the server sending the wrong content type to the browser so it thinks and treats, correctly, the content as plain text.

It's not a Mozilla problem but a server side problem.

But in Mozilla Firebird version 0.8 this will change. Mozilla Firebird will get a lot smarter about situations like this. Mozilla Firebird is gonna get autodection of binary content.

You can see all of the coding details in bug 220807. But basiclly what is being done is that Mozilla downloads a small part of the file and then tries to determine if the content is binary. If it is then Mozilla tries to find an helper application based on the extension of the file, to launch.

Read more about the 0.8 branch

December 18, 2003 12:50 PM | Posted in Mozilla


Back Next


WinXP SP2 will change its default MIME type behaviour to a stricter one:

Comment by Olivier Cahagne at December 18, 2003 11:27 PM | Permalink

I hope this is done in a sane way. Like allowing you to right click on a link and have it give you an option to view/save it in a different way, and not just catering to stupidity. That would start to lead us down the road to a adding a IE mode to page rendering...

Site icon Comment by Sharki at December 19, 2003 06:50 AM | Permalink

Sharki: The implementation is very sane. bz wouldn't do it any other way. It only applies if the Content-Type is either "text/plain" or "text/plain; charset=iso-8859-1", which are the default setting on most versions of Apache, and the text does not start with a Unicode byte order mark signifying UTF-16/32, and the body contains embedded ASCII control characters, such as NUL. It's not going to start ignoring valid Content Types, and if your text/plain document has control characters in it, and isn't Unicode, then you're breaking the HTTP standard anyway.

Site icon Comment by Ted Mielczarek at December 19, 2003 02:53 PM | Permalink

But now webmasters won't have any reason to fix their servers. Atleast before there were some people who would complain. Now they can say that it works, so they shouldn't have to fix it.

Site icon Comment by Sharki at December 20, 2003 05:46 AM | Permalink

Can anyone confirm this fix will also end-up in the normal mozilla build or only in Firebird ?



Site icon Comment by Stef at December 22, 2003 02:24 PM | Permalink

Post a comment

Remember Me?

Please enter the security code you see here

You're here: Home - Autodetect correct MIME type from text/plain content
Get the Mozilla Firefox browser