Appendix C. Common MIME Types

Every HTTP response that’s more than just headers must specify a MIME type via the Content-Type header (accessible as $response->content_type( )). Here is a list of the usual MIME type for each of the most common file types on the Internet. The items are sorted alphabetically by the usual extensions.

Regrettably, this list is neither complete nor authoritative, as there are more file types in use than those given “official” MIME types. For more information, see HTTP: The Definitive Guide (O’Reilly). Also consider the mime.types file that comes with Apache and/or your browser’s “Helper Applications” configuration menus. For the list of official MIME types, see http://www.isi.edu/in-notes/iana/assignments/media-types/.

Extension

MIME type

.au

audio/basic

.avi

video/msvideo, video/avi, video/x-msvideo

.bmp

image/bmp

.bz2

application/x-bzip2

.css

text/css

.dtd

application/xml-dtd

.doc

application/msword

.exe

application/octet-stream

.gif

image/gif

.gz

application/x-gzip

.hqx

application/mac-binhex40

.html

text/html

.jar

application/java-archive

.jpg

image/jpeg

.js

application/x-javascript

.midi

audio/x-midi

.mp3

audio/mpeg

.mpeg

video/mpeg

.ogg

audio/vorbis, application/ogg

.pdf

application/pdf

.pl

application/x-perl

.png

image/png

.ppt

application/vnd.ms-powerpoint

.ps

application/postscript

.qt

video/quicktime

.ra

audio/x-pn-realaudio, audio/vnd.rn-realaudio

.ram

audio/x-pn-realaudio, audio/vnd.rn-realaudio

.rdf

application/rdf, ...

Get Perl & LWP 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.