MIME-Types

The Multipurpose Internet Mail Extensions, known also as MIME type, is a specification extending the format of email to support sending images, audio/video files, archives, etc. The specification is standardized in IETF RFC 6838.

Browsers generally use the MIME type (and not the file extension) to determine how to process a document; that’s why it is important to set up servers correctly for attaching a proper MIME type to the response object’s header. If it is not configured correctly, browsers may misinterpret the files’ contents, and sites won’t work correctly. Downloaded files may be mishandled as well.

Syntax

Type/Subtype

The structure of MIME-type consists of a type and subtype, separated by a slash (/), without spaces. MIME-type is not case-sensitive, but it is commonly written in lower case.

A MIME type must always have both a type and subtype. Each type has its set of possible subtypes.

To provide additional details, you can use an optional parameter.

type/subtype;parameter=value

MIME-types are divided into two types: discrete and multipart. Each of them has specific subtypes.

Discrete Types

text/plain
text/html
image/jpeg
image/png
audio/mpeg
audio/ogg
audio/*
video/mp4
application/*
application/json
application/javascript
application/ecmascript
application/octet-stream
…

Discrete type indicates the category of the document, it can be one of the following:

TypeDescriptionExample of typical subtypes
applicationContains binary dataapplication/javascript, application/octet-stream,
application/pkcs12,
application/vnd.mspowerpoint,
application/xhtml+xml, application/xml,
application/pdf
audioAudiofileaudio/midi , audio/mpeg, audio/webm,
audio/ogg, audio/wav
examplePlaceholder in examplesaudio/example
fontFont/typeface datafont/woff, font/ttf, and font/otf
modelModel data for 3D objectmodel/3mf, model/vml
textText documenttext/plain , text/html , text/css, text/javascript
videoVideo filevideo/webm , video/ogg

For describing a text document, that doesn’t belong to a particular subtype, text/plain is used. Documents containing binary data without a specific subtype are described using application/octet-stream.

Multipart Types

multipart/form-data
multipart/byteranges

Multipart types indicate a category of the document, which consists of several parts, and each one can belong to different MIME-types.

TypeDescriptionExample of typical subtypes
messageMessage that covers other messagesmessage/rfc822, message/partial
multipartData composed of multiple componentsmultipart/form-data, multipart/byteranges

Table of MIME-Types

File extensionMedia Types and Subtypes
123application/vnd.lotus-1-2-3
3dmfx-world/x-3dmf
3dsimage/x-3ds
669audio/x-mod
aiapplication/postscript
aifaudio/aiff
aifaudio/x-aiff
aiffaudio/aiff
aiffaudio/x-aiff
aniapplication/x-navi-animation
aosapplication/x-nokia-9000-communicator-add-on-software
apsapplication/mime
arcapplication/octet-stream
arjapplication/arj
arjapplication/octet-stream
artimage/x-jg
asfvideo/x-ms-asf
asmtext/x-asm
asptext/asp
asxapplication/x-mplayer2
asxvideo/x-ms-asf
asxvideo/x-ms-asf-plugin
auaudio/basic
auaudio/x-au
aviapplication/x-troff-msvideo
avivideo/avi
avivideo/msvideo
avivideo/x-msvideo
binapplication/mac-binary
binapplication/macbinary
binapplication/octet-stream
binapplication/x-binary
binapplication/x-macbinary
bmimage/bmp
bmpimage/bmp
bmpimage/x-windows-bmp
booapplication/book
bookapplication/book
ctext/x-c
c++text/plain
ccadapplication/book
classapplication/java
classapplication/java-byte-code
classapplication/x-java-class
comapplication/octet-stream
comtext/plain
conftext/plain
cpptext/x-c
cptapplication/mac-compactpro
cptapplication/x-compactpro
cptapplication/x-cpt
cssapplication/x-pointplus
csstext/css
dcrapplication/x-director
deftext/plain
difvideo/x-dv
dirapplication/x-director
dlvideo/dl
dlvideo/x-dl
docapplication/msword
dotapplication/msword
drwapplication/drafting
dviapplication/x-dvi
dwgapplication/acad
dwgimage/vnd.dwg
dwgimage/x-dwg
dxfapplication/dxf
dxfimage/vnd.dwg
dxfimage/x-dwg
dxrapplication/x-director
exeapplication/octet-stream
gifimage/gif
gzapplication/x-compressed
gzapplication/x-gzip
gzipapplication/x-gzip
gzipmultipart/x-gzip
htext/plain
htext/x-h
hlpapplication/hlp
hlpapplication/x-helpfile
hlpapplication/x-winhelp
htctext/x-component
htmtext/html
htmltext/html
htmlstext/html
htttext/webviewhtml
icex-conference/x-cooltalk
icoimage/x-icon
infapplication/inf
jamaudio/x-jam
javtext/plain
javtext/x-java-source
javatext/plain
javatext/x-java-source
jcmapplication/x-java-commerce
jfifimage/jpeg
jfifimage/pjpeg
jfif-tbnlimage/jpeg
jpeimage/jpeg
jpeimage/pjpeg
jpegimage/jpeg
jpegimage/pjpeg
jpgimage/jpeg
jpgimage/pjpeg
jpsimage/x-jps
jsapplication/x-javascript
jsapplication/javascript
jsapplication/ecmascript
jstext/javascript
jstext/ecmascript
latexapplication/x-latex
lhaapplication/lha
lhaapplication/octet-stream
lhaapplication/x-lha
lhxapplication/octet-stream
listtext/plain
lspapplication/x-lisp
lsptext/x-script.lisp
lsttext/plain
lzhapplication/octet-stream
lzhapplication/x-lzh
lzxapplication/lzx
lzxapplication/octet-stream
lzxapplication/x-lzx
m3uaudio/x-mpequrl
manapplication/x-troff-man
midapplication/x-midi
midaudio/midi
midaudio/x-mid
midaudio/x-midi
midmusic/crescendo
midx-music/x-midi
midiapplication/x-midi
midiaudio/midi
midiaudio/x-mid
midiaudio/x-midi
midimusic/crescendo
midix-music/x-midi
modaudio/mod
modaudio/x-mod
movvideo/quicktime
movievideo/x-sgi-movie
mp2audio/mpeg
mp2audio/x-mpeg
mp2video/mpeg
mp2video/x-mpeg
mp2video/x-mpeq2a
mp3audio/mpeg3
mp3audio/x-mpeg-3
mp3video/mpeg
mp3video/x-mpeg
mp4video/mp4
mpaaudio/mpeg
mpavideo/mpeg
mpegvideo/mpeg
mpgaudio/mpeg
mpgvideo/mpeg
mpgaaudio/mpeg
pastext/pascal
pclapplication/vnd.hp-pcl
pclapplication/x-pcl
pctimage/x-pict
pcximage/x-pcx
pdfapplication/pdf
picimage/pict
pictimage/pict
pltext/plain
pltext/x-script.perl
pmimage/x-xpixmap
pmtext/x-script.perl-module
pm4application/x-pagemaker
pm5application/x-pagemaker
pngimage/png
potapplication/mspowerpoint
potapplication/vnd.ms-powerpoint
ppaapplication/vnd.ms-powerpoint
ppsapplication/mspowerpoint
ppsapplication/vnd.ms-powerpoint
pptapplication/mspowerpoint
pptapplication/powerpoint
pptapplication/vnd.ms-powerpoint
pptapplication/x-mspowerpoint
ppzapplication/mspowerpoint
psapplication/postscript
psdapplication/octet-stream
pwzapplication/vnd.ms-powerpoint
pytext/x-script.phyton
pycapplicaiton/x-bytecode.python
qtvideo/quicktime
qtifimage/x-quicktime
raaudio/x-pn-realaudio
raaudio/x-pn-realaudio-plugin
raaudio/x-realaudio
ramaudio/x-pn-realaudio
rmapplication/vnd.rn-realmedia
rmaudio/x-pn-realaudio
rpmaudio/x-pn-realaudio-plugin
rtfapplication/rtf
rtfapplication/x-rtf
rtftext/richtext
rtxapplication/rtf
rtxtext/richtext
rvvideo/vnd.rn-realvideo
sgmltext/sgml
sgmltext/x-sgml
shapplication/x-bsh
shapplication/x-sh
shapplication/x-shar
shtext/x-script.sh
shtmltext/html
shtmltext/x-server-parsed-html
ssitext/x-server-parsed-html
tarapplication/x-tar
tclapplication/x-tcl
tcltext/x-script.tcl
textapplication/plain
texttext/plain
tgzapplication/gnutar
tgzapplication/x-compressed
tifimage/tiff
tifimage/x-tiff
tiffimage/tiff
tiffimage/x-tiff
txttext/plain
uritext/uri-list
vcdapplication/x-cdlink
vmdapplication/vocaltec-media-desc
vrmlapplication/x-vrml
vrmlmodel/vrml
vrmlx-world/x-vrml
vsdapplication/x-visio
vstapplication/x-visio
vswapplication/x-visio
wavaudio/wav
wavaudio/x-wav
wmfwindows/metafile
xlaapplication/excel
xlaapplication/x-excel
xlaapplication/x-msexcel
xlbapplication/excel
xlbapplication/vnd.ms-excel
xlbapplication/x-excel
xlcapplication/excel
xlcapplication/vnd.ms-excel
xlcapplication/x-excel
xldapplication/excel
xldapplication/x-excel
xlkapplication/excel
xlkapplication/x-excel
xllapplication/excel
xllapplication/vnd.ms-excel
xllapplication/x-excel
xlmapplication/excel
xlmapplication/vnd.ms-excel
xlmapplication/x-excel
xlsapplication/excel
xlsapplication/vnd.ms-excel
xlsapplication/x-excel
xlsapplication/x-msexcel
xltapplication/excel
xltapplication/x-excel
xlvapplication/excel
xlvapplication/x-excel
xlwapplication/excel
xlwapplication/vnd.ms-excel
xlwapplication/x-excel
xlwapplication/x-msexcel
xmaudio/xm
xmlapplication/xml
xmltext/xml
zapplication/x-compress
zapplication/x-compressed
zipapplication/x-compressed
zipapplication/x-zip-compressed
zipapplication/zip
zipmultipart/x-zip
zooapplication/octet-stream
zooapplication/x-zoo
zshtext/x-scriptzsh

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *