|
What's this MIME thing, and what does it have to do with the WWW?
MIME stands for Multipurpose Internet Mail Extension and was originally intended to facilitate sending non-text email between different systems and architechtures.The HTTP protocol, which is the protocol used to implement the World Wide Web, adopted the already existing MIME standard for dealing with special file types such as audio and video.
The key to this trick is the Content-Type: header which is included in a MIME mail message. This header declares to the mailreading program what sort of data it is about to receive. The mailreader can then behave accordingly. In order for this to work, the mail sender and the mail reader must agree on what each content type is - otherwise the sender might send a game binary, and the reciever might attempt to play it on the audio device.
The web works the same way, the http daemon has a configuration file called mime.types which maps filename exensions to content types. This is how the server knows a .txt file is content type text/plain and a .html file is text/html and a .gif file is image/gif. The server sends a content type header to the web browser and based on the header the browser interprets the data.
Who makes up content types?
The IANA. You may get the current standard from
ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types
What if I need a type that isn't in that file?
The standard for non-standard types, as it were, is to prefix them with x-. Examples currently in Panix's configuration are:
application/x-director dir dcr dxr
audio/x-pn-realaudio ra
x-world/x-vrml wrl wrml
The first two examples show the standard types _application_ and _audio_ combined with non-standard subtypes, _x-director_ and _x-pn-realaudio_ respectively . The second example shows both a non-standard type and a non-standard subtype, x-world/x-vrml.
If you are a developer and want to write a 'helper-app' for use with netscape and friends, you must familiarize yourself with this standard and choose a content type that adheres to it. In other words, you must use the x-prefix for non-standard types and subtypes.
But why doesn't type foo work?
If you've gotten this far, you may have figured out the major plot point of the story by now. Not all developers adhere to the standard. We occasionally get mail that reads like the following...
Hi! I heard that fooapp is really nifty and I want to serve foo pages on my web site. The people at foosoft told me I have to ask you to install the following in your mime.types file:
application/fooview foo FOO
Can you please do this ASAP so I can start using foo pages? Thanks!
The answer to this is no. fooview is a non-standard subtype and we won't install it. We would however happily install application/x-fooview upon request. Users who wish to view your foo page must configure their browser to call the fooview.exe program when the browser sees a content type of application/x-fooview. Then everything will work just hunky-dorey.
The glitch here is that the fooview people are probably automatically configuring the browsers they are installing into to respond to foovew, not x-fooview. If this is the case, you should write/call/fax/singing-telegram the writers of the software and explain to them that they are breaking the standard. Tell them this is a PITA to you and will they please fix their software to at the very least respond to both fooview and x-foovew.
All that said, it is possible for you to install a MIME type that affects your webspace only, by placing a server directive in your .htaccess file. The best thing about this is that you can do it yourself and don't have to wait for Panix staff to get around to modifying the server configuration. For the above example, the directive should be of the form
AddType application/x-fooview foo
View the current supported mime types: mime.types