knowledge/technology/files/MIME.md

132 lines
9.2 KiB
Markdown
Raw Normal View History

2023-12-04 10:02:23 +00:00
---
obj: concept
---
# MIME Type
A media type (also known as a MIME type) is a two-part identifier for [file formats](File%20Formats.md) and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. Media types were originally defined in Request for Comments RFC 2045 (MIME) Part One: Format of Internet Message Bodies (Nov 1996) in November 1996 as a part of MIME (Multipurpose Internet Mail Extensions) specification, for denoting type of [email](../internet/eMail.md) message content and attachments; hence the original name, MIME type. Media types are also used by other internet protocols such as [HTTP](../internet/HTTP.md) and document [file formats](File%20Formats.md) such as [HTML](../internet/HTML.md), for similar purposes.
A list of supported MIME Types can be found at `/etc/mime.types`
## Naming
A media type consists of a _type_ and a _subtype_, which is further structured into a _tree_. A media type can optionally define a _suffix_ and _parameters_:
`type "/" [tree "."] subtype ["+" suffix]* [";" parameter]`
As of November 1996, the registered types were: `application`, `audio`, `image`, `message`, `multipart`, `text` and `video`. By December 2020, the registered types included the foregoing, plus `font`, `example`, and `model`.
An unofficial top-level name in common use is `chemical`.
As an example, an [HTML](../internet/HTML.md) file might be designated `text/html; charset=UTF-8`. In this example, `text` is the type, `html` is the subtype, and `charset=UTF-8` is an optional parameter indicating the character encoding.
A subtype typically consists of a media format, but it may or must also contain other content, such as a tree prefix, producer, product or suffix, according to the different rules in registration trees.
Types, subtypes, and parameter names are case-insensitive. Parameter values are usually case-sensitive, but may be interpreted in a case-insensitive fashion depending on the intended use.
## Common MIME Types Files
### Application
| MIME Type | Extensions | Description |
| --------------------------------- | ---------- | --------------------------------- |
| application/epub+zip | epub | - |
| application/gzip | gz tgz | [ZIP](ZIP.md) Files |
| application/http | - | [HTTP](../internet/HTTP.md) |
| application/javascript | .js | Javascript |
| application/json | json | [JSON](JSON.md) Data |
| application/pdf | pdf | [PDF](PDF.md) Document |
| application/pem-certificate-chain | pem | Certificates |
2024-01-17 08:00:45 +00:00
| application/pgp-encrypted | pgp | [PGP](../cryptography/GPG.md) Data |
| application/pgp-keys | - | [PGP](../cryptography/GPG.md) Keys |
| application/pgp-signature | sig | [PGP](../cryptography/GPG.md) Signatures |
2023-12-04 10:02:23 +00:00
| application/rtf | rtf | RTF Document |
2024-01-17 08:00:45 +00:00
| application/sql | sql | [SQL](../dev/programming/languages/SQL.md) Databases |
2023-12-04 10:02:23 +00:00
| application/wasm | wasm | WebAssembly |
| application/xml | xml | [XML](XML.md) |
| application/zip | zip | [ZIP](ZIP.md) Files |
| application/zstd | zst | Zstd Compression |
2024-01-17 08:00:45 +00:00
| application/x-bittorrent | torrent | [Torrent](../internet/BitTorrent.md) |
2023-12-04 10:02:23 +00:00
| application/x-java-archive | jar | Java |
| application/x-latex | latex | LATeX |
| application/x-rpm | rpm | Fedora Package |
| application/x-sh | sh | [Shell](../applications/cli/Shell.md) |
2024-01-17 08:00:45 +00:00
| application/x-tar | tar | [TAR](../applications/cli/compression/tar.md) |
2023-12-04 10:02:23 +00:00
| application/x-xz | xz | XZ Compression |
| application/msgpack | - | [MessagePack](MessagePack.md) |
| application/toml | .toml | [TOML](TOML.md) |
### Audio
| MIME Type | Extensions | Description |
| ---------------- | ------------------- | -------------------------------------- |
| audio/aac | adts, aac, ass | - |
| audio/mp4 | m4a | - |
| audio/mpeg | mp3, mpga, mp1, mp2 | - |
| audio/ogg | oga, ogg, opus,spx | Ogg |
2024-01-17 08:00:45 +00:00
| audio/opus | - | [Opus](media/audio/Opus.md) |
2023-12-04 10:02:23 +00:00
| audio/vorbis | - | Vorbis |
| audio/midi | mid, midi | MIDI |
| audio/x-aiff | aif, aiff, aifc | AIFF |
2024-01-17 08:00:45 +00:00
| audio/x-flac | flac | [FLAC](media/audio/FLAC.md) |
| audio/x-matroska | mka | [Matroska](media/Matroska.md) Audio |
| audio/x-wav | wav | [WAV](media/audio/WAV.md) |
2023-12-04 10:02:23 +00:00
### Font
| MIME Type | Extensions | Description |
| --------- | ---------- | ----------- |
| font/ttf | ttf | - |
| font/otf | otf | |
### Image
| MIME Type | Extensions | Description |
| ------------- | -------------------- | ------------------------------------ |
| image/heif | heif | HEIF Image |
2024-01-17 08:00:45 +00:00
| image/avif | avif | [AVIF](media/image/AVIF.md) Image |
2023-12-04 10:02:23 +00:00
| image/bmp | bmp | BMP Image |
| image/gif | gif | GIF Image |
| image/jpeg | jpg, jpeg, jpe, jfif | JPEG Image |
| image/jxl | jxl | - |
2024-01-17 08:00:45 +00:00
| image/png | png | [PNG](media/image/PNG.md) Image |
2023-12-04 10:02:23 +00:00
| image/svg+xml | svg, svgz | SVG Image |
| image/tiff | tiff, tif | TIFF Image |
| image/webp | webp | WebP Image |
### Message
| MIME Type | Extensions | Description |
| ----------------------- | ---------- | ----------- |
| message/delivery-status | - | - |
| message/http | - | - |
| message/partial | - | - |
### Model
| MIME Type | Extensions | Description |
| ---------- | --------------- | ----------- |
| model/mesh | msh, mesh, silo | 3D Mesh |
| model/obj | obj | 3D Object |
### Multipart
| MIME Type | Extensions | Description |
| ------------------- | ---------- | ----------- |
| multipart/digest | - | - |
| multipart/encrypted | - | - |
| multipart/form-data | - | - |
| multipart/parallel | - | - |
### Text
| MIME Type | Extensions | Description |
| -------------- | -------------------------------------------------------------- | --------------- |
| text/calendar | ics | Calendar |
| text/css | css | [CSS](../internet/CSS.md) Stylesheets |
| text/csv | csv | [CSV](CSV.md) Data |
| text/directory | - | - |
| text/html | html, htm | [HTML](../internet/HTML.md) Data |
| text/markdown | markdown, md | [Markdown](Markdown.md) |
| text/plain | txt, asc, text, pm, el, c, h, cc, hh, cxx, hxx, f90, conf, log | Plain Text |
| text/rtf | rtf | RTF Document |
| text/xml | xml | [XML](XML.md) |
### Video
| MIME Type | Extensions | Description |
| ---------------- | ---------- | -------------------------------- |
2024-01-17 08:00:45 +00:00
| video/AV1 | - | [AV1](media/video/AV1.md) |
| video/H264 | - | [H.264](media/video/H.264.md) |
| video/H265 | - | [H.265](media/video/H.265.md) |
2023-12-04 10:02:23 +00:00
| video/mp4 | mp4, m4a | MP4 Video |
| video/quicktime | mov, qt | Quicktime |
| video/webm | webm | WebM Video |
2024-01-17 08:00:45 +00:00
| video/x-matroska | mkv | [Matroska](media/Matroska.md) |