Servers add a header to each document that tells the browser the type of file it is sending. The browser determines how to handle the file based on that information—whether to display the contents in the window, or to launch the appropriate plug-in or helper application.
The system for communicating media types closely resembles MIME (Multipurpose Internet Mail Extension), which was originally developed for sending attachments in email. The server needs to be configured to recognize each MIME type in order to successfully communicate the media type to the browser.
If you want to deliver media beyond the standard HTML files and graphics (such as a Shockwave Flash movie or an audio file), you should contact your server administrator to be sure the server is configured to support that MIME type. Most common formats are built in to current versions of server software, but if the format isn’t there already, the administrator can easily set it up if you provide the necessary information.
The exact syntax for configuring MIME types varies among server
software; however, they all require the same basic information: type,
subtype, and extension. Types are the most broad categories for
files. They include text, image, audio, video, application, etc.
Within each category are a number of subtypes. For instance, the file
type image
includes the subtypes
gif
,
jpeg
,
etc. The extension refers to the file’s suffix, which the
server uses to determine the file type and subtype. Not all
extensions are standardized.
Table 4-1 lists common media types by extension along with their MIME type/subtype information. The ASCII/Binary information is provided to aid in making upload decisions.
Of course, new technologies and file types are emerging every day, so keep in mind that it is the web designer’s responsibility to make sure that for any new media type the appropriate information is communicated to the server administrator.
Table 4-1. MIME types and subtypes by extension
Extension |
Type/Subtype |
Description |
ASCII/Binary |
---|---|---|---|
|
PostScript viewer |
A | |
|
|
AIFF file |
B |
|
|
Compressed AIFF file |
B |
|
|
μ-law sound file |
B |
|
|
AVI video file |
B |
|
|
Microsoft BMP file |
B |
|
|
Shockwave files |
B |
|
|
Microsoft Word document |
B |
|
|
Encapsulated PostScript |
A |
|
|
Self-extracting file or executable |
B |
|
|
Graphic in GIF format |
B |
|
|
Compressed file, use gunzip (Unix decompressor) |
B |
|
|
Mac BinHex Archive |
B |
|
|
HTML document |
A |
|
|
Graphic in JPEG format |
B |
|
|
MIDI audio file |
B |
|
|
QuickTime movie |
B |
|
|
Silicon Graphics movie |
B |
|
|
MPEG movie |
B |
|
|
Portable bitmap image |
B |
|
|
Kodak photo CD image |
B |
|
|
Portable Document Format (Acrobat file) |
B |
|
|
PICT image file |
B |
|
|
Perl source file |
A |
|
|
Graphic in PNG format |
B |
|
|
PowerPoint file |
B |
|
|
PostScript file |
A |
|
|
QuickTime movie |
B |
|
|
RealAudio file (and metafile) |
B |
|
|
Rich Text Format (Microsoft Word) |
A |
|
|
Rich Text Format (MSWord) |
A |
|
|
Self-extracting Archive (Stuffit file) |
B |
|
|
Stuffit Archive |
B |
|
|
Digitized sound file |
B |
|
|
Shockwave Flash file |
B |
|
|
Compressed file |
B |
|
|
TIFF image (requires external viewer) |
B |
|
|
ASCII text file |
A |
|
|
Waveform audio file |
B |
|
|
VRML 3D file (requires VRML viewer) |
B |
|
|
Microsoft Excel File |
B |
|
|
B |
Get Web Design in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.