Media type#Personal or vanity tree

{{Short description|Identifier for file formats}}

{{Confusing|date=April 2023}}

In information and communications technology, a media type, content type or MIME type{{cite web|title=Media Types|url=https://www.iana.org/assignments/media-types/media-types.xhtml| website=IANA| publisher=IANA|access-date=5 June 2018|date=4 June 2018|quote=[RFC2046] specifies that Media Types (formerly known as MIME types) and Media Subtypes will be assigned and listed by the IANA.}} is a two-part identifier for file formats and content formats. Their purpose is comparable to filename extensions and uniform type identifiers, in that they identify the intended data format. They are mainly used by technologies underpinning the Internet, and also used on Linux desktop systems.

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 {{IETF RFC|2045}} (MIME) Part One: Format of Internet Message Bodies (Nov 1996) in November 1996 as a part of the MIME (Multipurpose Internet Mail Extensions) specification, for denoting type of email message content and attachments;{{cite web|first1=N.|last1=Freed|first2=N.|last2=Borenstein|title=Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies|url=https://tools.ietf.org/html/rfc2045|date=November 1996|access-date=15 July 2015|publisher=Internet Engineering Task Force}} hence the original name, MIME type. Media types are also used by other internet protocols such as HTTP,{{cite web|url=https://tools.ietf.org/html/rfc1945#section-3.6|title=Hypertext Transfer Protocol -- HTTP/1.0|date=May 1996|access-date=2 Feb 2017|last1=Nielsen|first1=Henrik|last2=Fielding|first2=Roy T.|last3=Berners-Lee|first3=Tim}} document file formats such as HTML,{{cite web |url=https://www.w3.org/TR/html401/types.html#type-content-type|title=HTML 4.01 Specification|date=24 Dec 1999|access-date=2 Feb 2017}} and the XDG specifications implemented by Linux desktop environments,{{cite web |url=https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/ |title=shared-mime-info-spec |website=freedesktop.org |date=2023-09-03}} for similar purposes.

Terminology

Different internet standards or web standards bodies differ on the preferred term for this type of identifier.

The IANA and IETF use the term "media type", and consider the term "MIME type" to be obsolete, since media types have become used in contexts unrelated to email, such as HTTP. By contrast, the WHATWG continues to use the term "MIME type" and discourages use of the term "media type" as ambiguous, since it is used with a different meaning in connection with the CSS {{code|@media}} feature.{{cite web |url=https://mimesniff.spec.whatwg.org/#mime-type-representation |title=4.1. MIME type representation |quotation=Standards are encouraged to consistently use the term MIME type to avoid confusion with the use of media type as described in Media Queries. |work=MIME Sniffing Standard |institution=WHATWG |first=Gordon P. |last=Hemsley}}

The HTTP response header for providing the media type is {{code|Content-Type}}.{{cite IETF |rfc=9110 |std=97 |doi=10.17487/rfc9110 |issn=2070-1721 |first1=R. |last1=Fielding |first2=M. |last2=Nottingham |first3=J. |last3=Reschke |section=8.3.1 |sectionname=Media Type |quotation=HTTP uses media types [RFC2046] in the Content-Type (Section 8.3) and Accept (Section 12.5.1) header fields in order to provide open and extensible data typing and type negotiation. |title=HTTP Semantics |year=2022}} The W3C has used {{code|ContentType}} as an XML data-type name for a media type.{{cite web |url=https://www.w3.org/TR/xhtml-modularization/abstraction.html#s_common_attrtypes |title=4.3. Attribute Types |quotation=ContentType: A media type, as per [RFC2045]. |institution=W3C |work=XHTML Modularization 1.1 - Second Edition |date=2010-07-29}} XDG specifications implemented by Linux desktop environments continue to use the term "MIME type".

Structure

{{hatnote|Syntax notations in this section are in Extended Backus–Naur form, following RFC convention.}}

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:

: {{syntaxhighlight|2=ebnf|1=mime-type = type "/" [tree "."] subtype ["+" suffix]* [";" parameter];}}

As an example, an HTML file might be designated {{code|1=text/html; charset=UTF-8}}. In this example, {{code|text}} is the type, {{code|html}} is the subtype, and {{code|1=charset=UTF-8}} is an optional parameter indicating the character encoding.

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.

= Types =

The "type" part defines the broad use of the media type. As of November 1996, the registered types were: {{code|application}}, {{code|audio}},{{code|image}}, {{code|message}}, {{code|multipart}}, {{code|text}} and {{code|video}}. By July 2024, the registered types included the foregoing, plus {{code|font}}, {{code|example}}, {{code|model}}, and {{Code|haptics}}.

An unofficial top-level type in common use is Chemical file format#The Chemical MIME Project, used for chemical file formats.{{cite web|url=http://chemical-mime.sourceforge.net/|title=The chemical-mime-data project|author=Daniel Leidert, Egon Willighagen|date=2007|access-date=2016-04-28|archive-url=https://web.archive.org/web/20161008090203/http://chemical-mime.sourceforge.net/|archive-date=2016-10-08|url-status=dead}}{{cite web|url=https://www.ch.ic.ac.uk/chemime/|title=Chemical MIME Home page|date=22 December 1998|access-date=11 May 2019}}{{cite journal |last1=S. Rzepa |first1=Henry |last2=Murray-Rust |first2=Peter |last3=J. Whitaker |first3=Benjamin |date=14 August 1998 |title=The Application of Chemical Multipurpose Internet Mail Extensions (Chemical MIME) Internet Standards to Electronic Mail and World Wide Web Information Exchange |journal=Journal of Chemical Information and Modeling |publisher=American Chemical Society |volume= 38|issue= 6|pages= 976–982|doi=10.1021/ci9803233}} In the context of Linux desktop environments, the unofficial top-level types {{code|inode}} (inodes other than normal files, such as filesystem directories, device files or symbolic links),{{cite web |url=https://specifications.freedesktop.org/shared-mime-info-spec/0.21/ar01s02.html#id-1.3.16 |title=2.13. Non-regular files |work=Shared MIME Info Specification |publisher=freedesktop.org}} {{code|x-content}} (removable media, such as {{code|x-content/image-dcf}} for DCF digital cameras),{{cite web |url=https://specifications.freedesktop.org/shared-mime-info-spec/0.21/ar01s02.html#id-1.3.17 |title=2.14 Content types for volumes |work=Shared MIME Info Specification |publisher=freedesktop.org}} {{code|package}} (package manager packages) and {{code|x-office}} (generic categories of office productivity software document){{cite web |url=https://specifications.freedesktop.org/icon-naming-spec/latest/#mimetypes |title=Table 10: Standard MIME type icons |work=Icon Naming Specification |publisher=freedesktop.org}} are used.

=Subtypes=

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.

All media types should be registered using the IANA registration procedures. For the efficiency and flexibility of the media type registration process, different structures of subtypes can be registered in registration trees that are distinguished by the use of tree prefixes. Currently the following trees are created: standard (no prefix), vendor ({{code|vnd.}} prefix), personal or vanity ({{code|prs.}} prefix), unregistered ({{code|x.}} prefix). These registration trees were first defined in November 1996 (obsoleted RFC 2048 - currently RFC 6838). New registration trees may be created by IETF Standards Action for external registration and management by well-known permanent organizations (e.g. scientific societies).

==Standards tree==

The standards tree does not use any tree prefix. Examples are {{code|text/javascript}}, {{code|image/png}}.{{cite journal|last1=Freed|first1=N.|title=Media Type Specifications and Registration Procedures|journal=IETF Request for Comments (RFC) Pages - Test|date=January 2013|volume=RFC6838|url=https://tools.ietf.org/html/rfc6838|access-date=15 July 2015|publisher=Internet Engineering Task Force (IETF)|issn=2070-1721}}

Registrations in the standards tree must be either associated with IETF specifications approved directly by the IESG, or registered by an IANA recognized standards-related organization.

==Vendor tree==

The vendor tree includes media types associated with publicly available products. It uses the {{code|vnd.}} tree prefix. Examples are: {{code|application/vnd.ms-excel}}, {{code|application/vnd.oasis.opendocument.text|https://www.snapchat.com/add/e6e_7=application/vnd.oasis.opendocument.text}}.

The terms "vendor" and "producer" are considered equivalent in the context. Industry consortia as well as non-commercial entities can register media types in the vendor tree. A registration in the vendor tree may be created by anyone who needs to interchange files associated with some software product or set of products. However, the registration belongs to the vendor or organization producing the software that employs the type being registered, and that vendor or organization can at any time elect to assert ownership of a registration done by a third party.

==Personal or vanity tree==

The personal or vanity tree includes media types associated with non publicly available products or experimental media types. It uses the {{code|prs.}} tree prefix. Examples are {{code|audio/prs.sid}}, {{code|image/prs.btif}}.

==Unregistered tree==

The unregistered tree includes media types intended exclusively for use in private environments and only with the active agreement of the parties exchanging them. It uses the {{code|x.}} tree prefix. Examples are {{code|application/x.foo}}, {{code|video/x.bar}}. Media types in this tree cannot be registered.

This type was originally defined in RFC 1590 (published in September 1993) using the {{code|x-}} or {{code|X-}} prefix. RFC 2048 (published in November 1996) introduced the {{code|x.}} prefix, but discouraged use of the unregistered tree, as new personal and vendor trees with relaxed registration requirements are now available. The current RFC 6838 (published in January 2013) maintains the same recommendation, but subtypes prefixed with {{code|x-}} or {{code|X-}} are no longer considered to be members of this tree.

Media types that have been widely deployed (with a subtype prefixed with {{code|x-}} or {{code|X-}}) without being registered, should be, if possible, re-registered with a proper prefixed subtype. If this is not possible, the media type can, after an approval by both the media types reviewer and the IESG, be registered in the standards tree with its unprefixed subtype. {{code|application/x-www-form-urlencoded}} is an example of a widely deployed type that ended up registered with the {{code|x-}} prefix.{{cite web |title=application/x-www-form-urlencoded (registered 2014-05-14, updated 2014-05-14, updated 2020-07-14) |url=https://www.iana.org/assignments/media-types/application/x-www-form-urlencoded}}

=Suffix=

Suffix is an augmentation to the media type definition to additionally specify the underlying structure of that media type, allowing for generic processing based on that structure and independent of the exact type's particular semantics. Media types that make use of a named structured syntax should use the appropriate IANA registered {{code|"+"suffix}} for that structured syntax when they are registered. Unregistered suffixes should not be used (since January 2013). Structured syntax suffix registration procedures are defined in RFC 6838.

The +xml suffix has been defined since January 2001 (RFC 3023{{Cite journal|last=Kohn |first=Dan|title=XML Media Types|url=https://tools.ietf.org/html/rfc3023.html|access-date=2021-03-05|website=tools.ietf.org|date=January 2001|language=en}}), and was formally included in the initial contents of the Structured Syntax Suffix Registry along with {{code|+json}}, {{code|+ber}}, {{code|+der}}, {{code|+fastinfoset}}, {{code|+wbxml}}, and {{code|+zip}} in January 2013 (RFC 6839). Subsequent additions include {{code|+gzip}}, {{code|+cbor}}, {{code|+json-seq}}, and {{code|+cbor-seq}}.{{cite web|url=https://www.iana.org/assignments/media-type-structured-suffix/media-type-structured-suffix.xml |title=Structured Syntax Suffix Registry|publisher=IANA|date=2012-07-20|access-date=2019-11-08|format=XML}}

=Common examples=

From the IANA registry:

{{div col|colwidth=25em}}

  • {{code|application/json}}
  • {{code|application/ld+json}} (JSON-LD)
  • {{code|application/msword}} (.doc)
  • {{code|application/pdf}}
  • {{code|application/sql}}
  • {{code|application/vnd.api+json}}
  • {{code|application/vnd.microsoft.portable-executable}} (.efi, .exe, .dll)
  • {{code|application/vnd.ms-excel}} (.xls)
  • {{code|application/vnd.ms-powerpoint}} (.ppt)
  • {{code|application/vnd.oasis.opendocument.text}} (.odt)
  • {{code|application/vnd.openxmlformats-officedocument.presentationml.presentation}} (.pptx)
  • {{code|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet}} (.xlsx)
  • {{code|application/vnd.openxmlformats-officedocument.wordprocessingml.document}} (.docx)
  • {{code|application/x-www-form-urlencoded}}
  • {{code|application/xml}}
  • {{code|application/zip}}
  • {{code|application/zstd}} (.zst)
  • {{code|audio/mpeg}}
  • {{code|audio/ogg}}
  • {{code|image/avif}}
  • {{code|image/jpeg}} (.jpg, .jpeg, .jfif, .pjpeg, .pjp) {{Cite web|url=https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#jpeg|title = MIME types (IANA media types) - HTTP | MDN| date=18 December 2023 }}
  • {{code|image/png}}
  • {{code|image/svg+xml}} (.svg)
  • {{code|image/tiff}} (.tif)
  • {{code|model/obj}} (.obj)
  • {{code|multipart/form-data}}
  • {{code|text/plain}}
  • {{code|text/css}}
  • {{code|text/csv}}
  • {{code|text/html}}
  • {{code|text/javascript}}(.js)
  • {{code|text/xml}}

{{div col end}}

Mailcap

{{see also|File association}}

Mailcap (derived from the phrase "mail capability") is a type of meta file used to configure how MIME-aware applications such as mail clients and web browsers render files of different MIME-types. The mailcap format is defined by RFC 1524 "A User Agent Configuration Mechanism for Multimedia Mail Format Information" but is not defined as an Internet standard. It is supported by most Unix systems.

Lines can be comments starting with the # character, or a mime-type followed by how to handle that mime type.

mime.types

An associated file is the mime.types file, which associates filename extensions with a MIME type. If the MIME type is properly set, this is unnecessary, but MIME types may be incorrectly set, or set to a generic type such as {{code|application/octet-stream}}, and mime.types allows one to fall back on the extension in these cases. Similarly, since many file systems do not store MIME type information, but instead rely on the filename extension, a mime.types file is frequently used by web servers to determine MIME type.

When viewing a file, these two work together as follows: {{code|mime.types}} associates an extension with a MIME type, while mailcap associates a MIME type with a program.

In UNIX-type systems, the mime.types file is usually located at /etc/mime.types and/or $HOME/.mime.types and the format is simply that each line is a space-delimited list of a MIME type, followed by zero or more extensions. For example, the HTML type can be associated with the extensions {{code|.htm}} and {{code|.html}} by the following line:

text/html htm html

= Netscape use =

{{missing information|section|2=Netscape|date=November 2019}}

The mime.types file dates to Netscape, where it used a different format;WEBMASTERS: [http://venus.soci.niu.edu/~archives/WEBMASTERS/nov97/0054.html mime types] {{webarchive|url=https://archive.today/20001207065300/http://venus.soci.niu.edu/~archives/WEBMASTERS/nov97/0054.html |date=2000-12-07 }}, John McAnally, Thu, 22 Jan 1998 15:29:29 -0600 (CST) it used key–value pairs and a comma-separated list of extensions, together with a standard header consisting of a specific comment that identifies the file as a mime.types file, as follows:

#--Netscape Communications Corporation MIME Information

# Do not delete the above line. It is used to identify the file type.

type=text/html exts=htm,html

See also

References

{{reflist|30em}}