How to Set Mime Types
MIME types describe the media type of email and, more recently, web servers and applications. While specific file extensions are usually used for certain file types, they are not required to be used for a certain file type; also, a particular file type may have many file extensions. MIME types define how the media type should be displayed or operate without ambiguity. However, Mozilla points out that as new content types are invented or implemented into web servers, administrators of those servers may fail to add the new MIME types. You can add MIME types by creating an .htaccess file and uploading it to your server.
Instructions
-
-
1
Determine the MIME type of the file you want to use for your content. If you used a software application to create the content, look at the software's documentation to determine the correct content, or search the IANA MIME Media Types registry to locate the correct MIME type for your content (this registry contains all registered MIME types -- see Resources).
-
2
Open your preferred text editor. Make sure that your text editor is capable of creating .htaccess files; TextPad, UltraEdit and Microsoft WordPad all have this capability, but Microsoft Notepad does not.
-
-
3
Add the MIME type and file extension associated with the type preceded by the text "AddType" to a new text document in your text editor. Add each type as a new line. For example, to add MIME types for JPEG and PDF files, type:
AddType image/jpeg .jpg
AddType application/pdf .pdf
-
4
Save the file as an .htacces file. Click "File," then "Save As" to save the file. Name the file ".htaccess" and then click "Save."
-
5
Upload the .htaccess file to the main directory of your web server. This can be done with the "File Manager" application provided by your host or through an FTP client.
-
1
Tips & Warnings
Add MIME types for media content that is not displayed properly. You do not need to go through this process if your content is being displayed correctly.
References
Resources
- Photo Credit photo image by gilles vallée from Fotolia.com