MIME Types

From SwinBrain

Contents

About MIME Content Types

"MIME types", "MIME Media Types" or more correctly "MIME content types", are a small part of the larger MIME internet standard. The Multipurpose Internet Mail Extension (MIME) standards are a vital part of the email we are all used to (SMTP/MIME), and the standards makes it possible for use to encode content, add email attachements and break messages into different parts.

MIME content types are written as type/subtype pairs (eg. text/html), and because this method of identifying different file types existed before the birth of the web, it was a good choice to use in identifying file and content types in HTTP and HTML. Any text type can also have an additional character set (charset) value.

The Internet Assigned Numbers Authority (IANA) keeps lists of registered MIME content types (http://www.iana.org/assignments/media-types/):

Common Internet/Web Related MIME Content Types

MIME Type/Subtype File Extension Description
text/html .html .htm Good ole HTML
text/css .css Cascading Style Sheet
text/javascript .js JavaScript
image/gif .gif GIF
image/jpeg .jpg .jpeg JPEG
image/png .png PNG
audio/x-wav .wav WAV (AVI audio only)
audio/x-mpeg .mp3 MP3 (Actually MPEG 1 Layer III audio)
video/quicktime .mov Apple QuickTime
video/x-mpeg .mpg MPEG video
application/pdf .pdf Adobe Portable Document Format

MIME and XHTML Documents

So what should we do with XHTML documents, given that they are actually XML (an "application of XML")? Here's a quote from the W3C specs at http://www.w3.org/TR/xhtml-media-types/

... In summary, 'application/xhtml+xml' SHOULD be used for XHTML Family documents, and the use of 'text/html' SHOULD be limited to HTML-compatible XHTML 1.0 documents. 'application/xml' and 'text/xml' MAY also be used, but whenever appropriate, 'application/xhtml+xml' SHOULD be used rather than those generic XML media types.

Further Information

[edit]Protocols: POP3 | SMTP | IMAP | MIME Types | HTTP | HTTPS | UDP/IP | TCP/IP | FTP | SCP | SSH | Telnet | BitTorrent