MediaType extends Collection

This collection provides metadata around media types (formerly known as MIME Types).

The format of a media type is a tree / subtype.

The source for media type data is at IANA Media Types.

Media TypeExtensionsNameNotesObsoleted ByUnsafe?
application/ecmascriptesEcmaScript moduletrue
application/emfemfWindows Enhanced Metafile
application/excelxlt,xla,xlsMicrosoft Excel
application/epub+zipepubElectronic publication (EPUB)
application/java-archivejarJava Archive (JAR)
application/javascriptjs,mjsJavaScript, JavaScript moduletrue
application/jsonjsonJSON format
application/mp4mp4MPEG 4
application/msworddoc,dotMicrosoft Word
application/octet-streambinbinary dataAny kind of binary data
application/oggogxOGG
application/pdfpdfAdobe Portable Document Format (PDF)
application/rtfrtfRich Text Format (RTF)
application/vnd.amazon.ebookazwAmazon Kindle eBook format
application/vnd.apple.installer+xmlmpkgApple Installer Package
application/vnd.mozilla.xul+xmlxulXUL
application/vnd.ms-excelxlsMicrosoft Excel
application/vnd.ms-accessmdbMicrosoft Access
application/vnd.ms-excelxlt,xla,xlsMicrosoft Excel
application/vnd.ms-excel.addin.macroEnabled.12xlamMicrosoft Excel Addin (Macro Enabled)
application/vnd.ms-excel.sheet.macroEnabled.12xlsmMicrosoft Excel (Macro Enabled)
application/vnd.ms-excel.sheet.binary.macroEnabled.12xlsbMicrosoft Excel Binary (Macro Enabled)
application/vnd.ms-excel.template.macroEnabled.12xltmMicrosoft Excel Template (Macro Enabled)
application/vnd.ms-fontobjecteotMS Embedded OpenType fonts
application/vnd.ms-powerpointppt,pot,pps,ppaMicrosoft PowerPoint
application/vnd.ms-word.document.macroEnabled.12docmMicrosoft Word (Macro Enabled)
application/vnd.ms-word.powerpoint.addin.macroEnabled.12ppamMicrosoft PowerPoint Addin (Macro Enabled)
application/vnd.ms-word.powerpoint.presentation.macroEnabled.12pptmMicrosoft PowerPoint Presentation (Macro Enabled)
application/vnd.ms-word.powerpoint.slideshow.macroEnabled.12ppsmMicrosoft PowerPoint Slideshow (Macro Enabled)
application/vnd.ms-word.powerpoint.template.macroEnabled.12potmMicrosoft PowerPoint Template (Macro Enabled)
application/vnd.ms-word.template.macroEnabled.12dotmMicrosoft Word Template (Macro Enabled)
application/vnd.oasis.opendocument.presentationodpOpenDocument presentation document
application/vnd.oasis.opendocument.spreadsheetodsOpenDocument spreadsheet document
application/vnd.oasis.opendocument.textodtOpenDocument text document
application/vnd.openxmlformats-officedocument.presentationml.presentationpptxMicrosoft PowerPoint (OpenXML)
application/vnd.openxmlformats-officedocument.presentationml.slideshowppsxMicrosoft PowerPoint Slideshow (OpenXML)
application/vnd.openxmlformats-officedocument.presentationml.templatepotxMicrosoft PowerPoint Template (OpenXML)
application/vnd.openxmlformats-officedocument.spreadsheetml.sheetxlsxMicrosoft Excel (OpenXML)
application/vnd.openxmlformats-officedocument.spreadsheetml.templatexltxMicrosoft Excel Template (OpenXML)
application/vnd.openxmlformats-officedocument.wordprocessingml.documentdocxMicrosoft Word (OpenXML)
application/vnd.openxmlformats-officedocument.wordprocessingml.templatedotxMicrosoft Word Template (OpenXML)
application/vnd.visiovsdMicrosoft Visio
application/x-abiwordabwAbiWord document
application/x-bzipbzBZip archive
application/x-bzip2bz2BZip2 archive
application/x-compressedzipZIP Archivetrue
application/x-cshcshC-Shell script
application/x-emfemfWindows Enhanced Metafile
application/x-excelxlt,xla,xlsMicrosoft Excel
application/x-freearcarcArchive document (multiple files embedded)
application/x-iwork-keynote-sffkeykeynoteApple iWork Keynote
application/x-iwork-numbers-sffnumbersnumbersApple iWork Numbers
application/x-iwork-pages-sffpagespagesApple iWork Pages
application/x-javascriptmjsJavaScriptapplication/javascripttrue
application/x-msexcelxlt,xla,xlsMicrosoft Excel
application/x-rar-compressedrarRAR archive
application/x-rtfrtfRich Text Format (RTF)
application/x-shockwave-flashswfSmall web format (SWF) or Adobe Flash document
application/x-tartarTape Archive (TAR)
application/x-shshBourne shell script
application/x-7z-compressed7z7-zip archive
application/x-zip-compressedzipZIP archivetrue
application/xhtml+xmlxhtmlXHTMLtrue
application/xmlxmlXML; not readable from casual users (RFC 3023, section 3)
application/zipzipZIP archivetrue
audio/3gpp3gp3GPP audio/video container; if it does not contain video
audio/3gpp23g23GPP2 audio/video container; if it does not contain video
audio/aacaacAAC audio
audio/midimid,midiMusical Instrument Digital Interface (MIDI)
audio/mpegmp3,mpgMP3 audio
audio/mpeg3mp3MP3 audio
audio/oggogaOGG audio
audio/wavwavWaveform Audio Format
audio/webmwebaWEBM audio
audio/x-midimid,midiMusical Instrument Digital Interface (MIDI)
audio/x-mpeg-3mp3MP3 audio
audio/x-wavwavWaveform Audio Format
font/ttfttfTrueType Font
font/otfotfOpenType font
font/woffwoffWeb Open Font Format (WOFF)
font/woff2woff2Web Open Font Format (WOFF)
image/bmpbmpWindows OS/2 Bitmap Graphics
image/gifgifGraphics Interchange Format (GIF)
image/jpegjpeg,jpgJPEG images
image/pngpngPortable Network Graphics
image/svg+xmlsvgScalable Vector Graphics (SVG)
image/tifftif,tiffTagged Image File Format (TIFF)
image/vnd.microsoft.iconicoIcon format
image/webpwebpWEBP image
image/x-emfemfWindows Enhanced Metafile
image/x-mgx-emfemfWindows Enhanced Metafile
image/x-iconicoIcon format
image/x-xbitmapemfWindows Enhanced Metafile
multipart/x-zipzipZIP Archivetrue
text/calendaricsiCalendar format
text/csscssCascading Style Sheets (CSS)true
text/csvcsvComma-separated values (CSV)
text/ecmascriptesEcmaScriptapplication/ecmascripttrue
text/htmlhtm,htmlHyperText Markup Language (HTML)true
text/javascriptjsJavaScriptapplication/javascripttrue
text/plaintxt,msgText, (generally ASCII or ISO 8859-n)
text/richtextrtfRich Text Format
text/xmlxmlXML; if readable from casual users (RFC 3023, section 3)
video/3gpp3gp3GPP; if it contains video
video/3gpp23g23GPP2 audio/video container; if it contains video
video/aviaviAVI: Audio Video Interleave
video/mp4m4v,mp4MP4 Video
video/mpegmpeg,mp3,mpgMPEG Video
video/oggogvOGG video
video/msvideoaviAVI: Audio Video Interleave
video/quicktimemov,qtApple QuickTime
video/webmwebmWEBM video
video/x-mpegmpeg,mp3MPEG Video
video/x-msvideoaviAVI: Audio Video Interleave

static

isValid(mediaType: string): boolean

This checks to see if the given mediaType is a valid media type.

The mediaType can have a wildcard specified for the subtype, i.e.: 'image/*'.

matches(validMediaTypes: string[], mediaType: string): boolean

This checks to see if the given mediaType matches an existing media type.

Any of the validMediaType can also have a wildcard specified for the subtype. For example, ['image/*', 'video/*'] will match all audio and video media types.

instance

_id: string

Contains the official media type name for this media type. Contains both the tree/type and the subtype.

extensions: string[]

This contains an array of valid extensions for this media type.

name: string

This contains a short name for this media type.

notes: string

This contains any additional notes about this media type.

obsolete: string

This indicates that this is an obsolete media type and this values contains the new value to use.

unsafe: boolean

This indicates that this file is not safe to download as a link.