MIME is an open standard for sending multipart, multimedia data through Internet email.[9] The data may be binary, or it may use multiple ASCII and non-ASCII character sets. Although MIME was originally intended for email, it has become a widely used technique to describe a file’s contents so that client software can tell the difference between different kinds of data. For example, a web browser uses MIME to tell whether a file is a GIF image or a printable PostScript file.
MIME supports almost a hundred predefined types of content. Content
types are classified at two levels: a type and a subtype. The type
shows very generally what kind of data is contained: is it a picture,
is it text, is it a movie? The subtype identifies the specific type
of data: GIF image, JPEG image, TIFF image. For example, HTML’s
content type is text/html
; the type is
text
, and the subtype is html
.
The content type for a GIF image is image/gif
; the
type is image
, and the subtype is
gif
. Table 3.2 lists the more
common defined content types. On most systems, a simple text file
maintains a mapping between MIME types and the application used to
process that type of data; on Unix, this file is called
mime.types
. The most current list of registered
MIME types is available from ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types.[10]
The data returned by an HTTP 1.0 or 1.1 web server is sent in MIME
format. Most web servers and clients understand at least two MIME
text content types, text/html
and
text/plain
, and two image formats,
image/gif
and image/jpeg
. The
Web also uses MIME for posting forms to web servers, a common way for
an applet to communicate with a server. Finally, Java relies on MIME
types to pick the appropriate content handler for a particular stream
of data.
Table 3-2. Predefined MIME Content Types
Type |
Subtype |
Description |
---|---|---|
text |
The document represents printable text. | |
calendar |
Calendaring and scheduling information in the iCalendar format; see RFC 2445. | |
css |
A Cascading Style Sheet used for HTML and XML. | |
directory |
Address book information such as name, phone number, and email address; used by Netscape vCards; defined in RFCs 2425 and 2426. | |
enriched |
A very simple HTML-like language for adding basic font and paragraph-level formatting such as bold and italic to email; used by Eudora; defined in RFC 1896. | |
html |
Hypertext Markup Language as used by web browsers. | |
plain |
This is supposed to imply raw ASCII text. However, some web servers
use | |
richtext |
This is an HTML-like markup for encoding formatting into pure ASCII text. It’s never really caught on, in large part because of the popularity of HTML. | |
rtf |
An incompletely defined Microsoft format for word processing files. | |
sgml |
The Standard Generalized Markup Language; ISO standard 8879:1986. | |
tab-separated-values |
The interchange format used by many spreadsheets and databases; records are separated by line breaks, and fields by tabs. | |
xml |
The W3C standard Extensible Markup Language. | |
multipart |
Multipart MIME messages encode several different files into one message. | |
mixed |
Several message parts intended for sequential viewing. | |
alternative |
The same message in multiple formats so a client may choose the most convenient one. | |
digest |
A popular format for merging many email messages into a single digest; used by many mailing lists and some FAQ lists. | |
parallel |
Several parts intended for simultaneous viewing. | |
byteranges |
Several separately contiguous byte ranges; used in HTTP 1.1. | |
encrypted |
One part for the body of the message and one part for the information necessary to decode the message. | |
signed |
One part for the body of the message and one part for the digital signature. | |
related |
Compound documents formed by aggregating several smaller parts. | |
form-data |
Form responses. | |
message |
An email message. | |
external-body |
Just the headers of the email message; the message’s body is not included but exists at some other location and is referenced, perhaps by a URL. | |
http |
An HTTP 1.1 request from a web client to a web server. | |
news |
A news article. | |
partial |
Part of a longer email message that has been split into multiple parts to allow transmission through email gateways. | |
rfc822 |
A standard email message including headers. | |
image |
Two-dimensional pictures. | |
cgm |
A Computer Graphics Metafile format image. CGM is ISO standard 8632:1992 for device-independent vector graphics and bitmap images. | |
g3fax |
The standard for bitmapped fax images. | |
gif |
A Graphics Interchange format image. The format was originally developed by CompuServe. It uses certain compression algorithms on which Unisys holds a patent. | |
jpeg |
The Joint Photographic Experts Group file format for bitmapped images with lossy compression. | |
png |
A Portable Network Graphics Format image. The format was developed at the W3C as a more modern replacement for GIF that supported 24-bit color and was not encumbered by patents. | |
tiff |
The Tagged Image File format from Adobe. | |
audio |
Sound. | |
basic |
8-bit ISDN -law encoded audio with a single channel and a sample
rate of eight kilohertz. This is the format used by
| |
video |
Video. | |
mpeg |
The Motion Picture Experts Group format for video data with lossy compression. | |
quicktime |
Apple’s proprietary QuickTime movie format. Before being included in a MIME message, QuickTime files must be “flattened”. | |
model |
3-D images. | |
vrml |
A Virtual Reality Modeling Language file, an evolving standard for 3-D data on the Web. | |
iges |
The Initial Graphics Exchange Specification for interchanging documents between different CAD programs. | |
mesh |
The mesh structures used in finite element and finite difference methods. | |
application |
Binary data specific to some application. | |
octet-stream |
Unspecified binary data, which is usually saved into a file for the
user. This MIME type is sometimes used to serve
| |
java |
A not-yet-standard subtype sometimes used to serve
| |
postscript |
Adobe PostScript. | |
dca-rft |
IBM’s Document Content Architecture-Richly Formatted Text. | |
mac-BinHex40 |
A means of encoding the two forks of a Macintosh document into a single ASCII file. | |
|
An Adobe Acrobat file. | |
zip |
A zip compressed file. | |
macwriteii |
A MacWrite II word processing document. | |
msword |
A Microsoft Word document. | |
xml |
A MIME-compliant program is not required to understand all these different types of data; it just needs to recognize what it can and cannot handle. Many programs—Netscape Navigator, for example—use various helper programs to display types of content they themselves don’t understand.
MIME allows you to define additional nonstandard subtypes by using
the prefix x-
. For example, the content type
application/x-tex
has the MIME type
application
and the nonstandard subtype
x-tex
for a TeX document. These x-types are not
guaranteed to be understood by any program other than the one that
created them. Indeed, two programs may use the same x-type to mean
two completely different things; or different programs may use
different x-types to mean the same thing. However, many nonstandard
types have come into common use; some of the more common ones are
listed in Table 3.3.
Table 3-3. X-types
Type |
X-subtype |
Description |
---|---|---|
application |
Subtypes of an application; the name of the subtype is usually a file format name or an application name. | |
x-aiff |
SGI’s AIFF audio data format. | |
x-bitmap |
An X Windows bitmap image. | |
x-gzip |
Data compressed in the GNU gzip format. | |
x-dvi |
A TeX DVI document. | |
x-framemaker |
A FrameMaker document. | |
x-latex |
A LaTeX document. | |
x-macBinHex40 |
Identical to | |
x-mif |
A FrameMaker MIF document. | |
x-sd |
A session directory protocol announcement, used to announce MBONE events. | |
x-shar |
A shell archive; the Unix equivalent of a Windows or Macintosh self-extracting archive. Software shouldn’t be configured to unpack shell archives automatically, because a shell archive can call any program the user who runs it has the rights to call. | |
x-tar |
A tar archive. | |
x-gtar |
A GNU tar archive. | |
x-tcl |
A tool command language (TCL) program. You should never configure your web browser or email program to automatically run programs you download from the web or receive in email messages. | |
x-tex |
A TeX document. | |
x-texinfo |
A GNU texinfo document. | |
x-troff |
A troff document. | |
x-troff-man |
A troff document written with the | |
x-troff-me |
A troff document that should be processed using the
| |
x-troff-ms |
A troff document that should be processed using the
| |
x-wais-source |
A WAIS source. | |
x-www-form-urlencoded |
A CGI query string that has been encoded like a URL, with + replacing spaces and % escapes replacing non-alphanumeric characters that aren’t separators. | |
audio | ||
x-aiff |
The same as | |
x-mpeg |
The MP3 sound format. | |
x-mpeg.mp3 |
The MP3 sound format. | |
x-wav |
The Windows WAV sound format. | |
image | ||
x-fits |
The FITS image format used primarily by astronomers. | |
x-macpict |
A Macintosh PICT image. | |
x-pict |
A Macintosh PICT image. | |
x-macpaint |
A MacPaint image. | |
x-pbm |
A portable bitmap image. | |
x-portable-bitmap |
A portable bitmap image. | |
x-pgm |
A PGM image. | |
video | ||
x-msvideo |
A Microsoft AVI Video for Windows. | |
x-sgi-movie |
[9] Officially, MIME stands for Multipurpose Internet Mail Extensions, which is the expansion of the acronym used in RFC 2045. However, you will hear other versions—most frequently, Multipart Internet Mail Extensions and Multimedia Internet Mail Extensions.
[10] For more details on MIME, see Jerry Sweet, Ed Vielmetti, and Tim Goodwin, The comp.mail.mime FAQ, http://www.cs.ruu.nl/wais/html/na-dir/mail/mime-faq/.html; N. Borenstein, Bellcore, “Multimedia Mail From the Bottom Up or Teaching Dumb Mailers to Sing”, ConneXions, pp. 10-16, Nov. 91; G. Vaudreuil, CNRI, “MIME: Multi-Media, Multi-Lingual Extensions for RFC 822 Based Electronic Mail”, ConneXions, pp. 36-39, Sep. 92.
18.219.22.107