A media type (formerly known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. Their purpose is somewhat similar to file extensions in that they identify the intended data format. 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 (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; hence the original name, MIME type. Media types are also used by other internet protocols such as HTTP and document file formats such as HTML element, for similar purposes.
As an example, an HTML file might be designated . In this example, is the type, is the subtype, and is an optional parameter indicating the character encoding.
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 ( prefix), personal or vanity ( prefix), unregistered ( 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).
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.
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.
This type was originally defined in RFC 1590 (published in September 1993) using the or prefix. RFC 2048 (published in November 1996) introduced the 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 or are no longer considered to be members of this tree.
Media types that have been widely deployed (with a subtype prefixed with or ) 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. is an example of a widely deployed type that ended up registered with the prefix.
The suffix has been defined since January 2001 (RFC 3023), and was formally included in the initial contents of the Structured Syntax Suffix Registry along with , , , , , and in January 2013 (RFC 6839). Subsequent additions include , , , and .
Lines can be comments starting with the # character, or a mime-type followed by how to handle that mime type.
When viewing a file, these two work together as follows: 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 and by the following line:
text/html htm html
#--Netscape Communications Corporation MIME Information # Do not delete the above line. It is used to identify the file type.