
18 Chapter 1 Web Technologies Overview
Understanding Multipurpose Internet Mail Extension
Multipurpose Internet Mail Extension (MIME) is an Internet standard for specifying what
happens when a web browser requests a file with certain characteristics. You can
choose the response you want the web server to make based on the file’s suffix. Your
choices will depend partly on what modules you have installed on your web server.
Each combination of a file suffix and its associated response is called a MIME type
mapping.
MIME Suffixes
A suffix describes the type of data in a file. Here are some examples:
• txt for text files
• cgi for Common Gateway Interface files
• gif for GIF (graphics) files
• php for PHP: Hypertext Preprocessor (embedded HTML scripts) used for WebMail,
and so on
• tiff for TIFF (graphics) files
Mac OS X Server includes a default set of MIME type suffixes. This set includes all the
suffixes in the mime.types file distributed with Apache, with a few additions. If a suffix
you need is not listed, or does not have the behavior you want, use Server Admin to
add the suffix to the set or to change its behavior.
Note: Do not add or change MIME suffixes by editing configuration files.
Web Server Responses (Content Handlers)
When a file is requested, the web server handles the file using the response specified
for the file’s suffix. Responses, also known as content handlers, can be either an action
or a MIME type. Possible responses include:
• Return file as MIME type (you enter the mapping you want to return)
• Send-as-is (send the file exactly as it exists)
• Cgi-script (run a CGI script you designate)
• Imap-file (generate an IMAP mail message)
• Mac-binary (download a compressed file in MacBinary format)
MIME type mappings are divided into two subfields separated by a forward slash, such
as text/plain. Mac OS X Server includes a list of default MIME type mappings. You can
edit these and add others using the Server Admin application.
When you specify a MIME type as a response, the server identifies the type of data
requested and sends the response you specify. For example, if the browser requests a
file with the suffix “jpg,” and its associated MIME type mapping is image/jpeg, the
server knows it needs to send an image file and that its format is JPEG. The server
doesn’t have to do anything except serve the data requested.
Komentarze do niniejszej Instrukcji