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 |
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, ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access