Simple MIME type handling test

This is a test of what happens when your browser encounters a document with an unusual file extension. What it should do is simply stated: It should always obey the MIME type, never the file extension.

MIME typeURL end with... What should happen
text/html file.html file.gif file.png file.txt file.exe file.zip file.foo file View in browser as HTML
image/gif file.html file.gif file.png file.txt file.exe file.zip file.foo file View image in browser
image/png file.html file.gif file.png file.txt file.exe file.zip file.foo file View image in browser
text/plain [A] file.html file.gif file.png file.txt file.exe file.zip file.foo file View plain text in browser
text/plain [B]
(plain text that looks like HTML)
file.html file.gif file.png file.txt file.exe file.zip file.foo file View plain text in browser
application/octet-stream [A]
(data looks like Windows executable)
file.html file.gif file.png file.txt file.exe file.zip file.foo file offer to Save to disk
application/octet-stream [B]
(data looks like plain text)
file.html file.gif file.png file.txt file.exe file.zip file.foo file offer to Save to disk
application/octet-stream [C]
(data looks like HTML)
file.html file.gif file.png file.txt file.exe file.zip file.foo file offer to Save to disk
application/octet-stream [D]
(data looks like GIF file)
file.html file.gif file.png file.txt file.exe file.zip file.foo file offer to Save to disk
application/zip file.html file.gif file.png file.txt file.exe file.zip file.foo file Save to disk or open application
x-foo/x-bar file.html file.gif file.png file.txt file.exe file.zip file.foo file Save to disk or open application

The links in any row differ only by "file extension", and since file extensions are supposed to be irrelevant on the web, they should all do the same thing. If they don't, your browser is broken.

Note that all the documents here really do contain legitimate data in the format indicated by the MIME type.

If you're totally confused by this, I suggest reading The Content-type Saga.


This entire test suite may be downloaded here: mimetest.zip.

Permission is granted for anyone to make public or private use of these test pages on their own web server; however, if this document is located somewhere other than entropymine.com, I cannot vouch for the correctness of the tests.

Important: These tests require a suitably configured Apache-compatible web server. In particular, it must be possible to override MIME types by the use of AddType and DefaultType directives in ".htaccess" configuration files. The tests will not work on your local hard disk, or on most free web site providers.

Tests by Jason Summers.