Associating file types with programs
The most common use of the Mime Types file is to associate file types with programs. The standard length for both the Macintosh file type and Macintosh file creator names is four characters. If you have less than four characters, you must use double quotes ("") around the entry and put spaces in for missing characters (for example, "mp3 ").
Mime Types file syntax
The basic MIME type syntax is:
mime type/subtype<tab>Mac type<tab>Mac creator<tab>filename extension
where,
mime type is the type of file
subtype is the subtype of the file
<tab> is a space
Mac type is the Macintosh file type
Mac creator is the browser type
filename extension is the extension of the file.
In keeping with the above syntax, a standard MIME type entry might be:
text/html<tab>text<tab>MSIE<tab>.html
This entry causes all files with an .html extension to be sent to the browser directly.
For video files, you could enter this line of code in the Mime Types file:
video/mpeg MPEG mPEG .mpeg
This entry causes all files with an .mpeg extension to be sent to the browser directly.
Although it is a good idea to put entries in for each variable in the MIME type syntax, the most important entries are the mime type, subtype, and filename extension. These entries must be entered for the MIME type code to work. You can enter question marks (?) for the Mac type and Mac creator variables, for example:
audio/basic ???? ???? .snd
where this entry specifies a basic audio file with the .snd extension, and both Mac type and Mac creator can be anything, as designated by the question mark (?).
Although there are many predefined MIME Types, such as GIF graphics files and PostScript files, you can also define your own, by adding a line for each in the Mime Types file. Some commonly used file extensions are:
• .shtml, .shtm, .shm, .inc
• .swm, .swmls, .wml
• .png, .pict, .bmp
• .txt
• .css.
|