Jump to content

Media type: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Max Terry (talk | contribs)
Line 149: Line 149:
* <code>application/x-javascript</code>:
* <code>application/x-javascript</code>:
* <code>application/x-deb</code>: [[deb (file format)]], a software package format used by the Debian project
* <code>application/x-deb</code>: [[deb (file format)]], a software package format used by the Debian project



===Prefix <code>x-pkcs</code>===
===Prefix <code>x-pkcs</code>===

Revision as of 03:50, 6 April 2012

An Internet media type[1] is a two-part identifier for file formats on the Internet. The identifiers were originally defined in RFC 2046 for use in email sent through SMTP, but their use has expanded to other protocols such as HTTP, RTP and SIP. These types were originally called MIME types, after MIME (Multipurpose Internet Mail Extensions), and are sometimes referred to as Content-types, after the name of a header in several protocols whose value is such a type.

A media type is composed of at least two parts: a type, a subtype, and one or more optional parameters. For example, subtypes of text have an optional charset parameter that can be included to indicate the character encoding (E.g.: text/html; charset=UTF-8), and subtypes of multipart type often define a boundary between parts. Allowed charset values are defined in the list of IANA character sets.

Types or subtypes that begin with x- are non-standard[2] (they are not registered with IANA). Subtypes that begin with vnd. are vendor-specific;[3] subtypes in the personal or vanity tree begin with prs..[4]

There are many predefined media types, such as GIF graphics files and PostScript files. It is also possible to define custom media types.

The original name MIME type referred to the fact that the these types were used to identify non-ASCII parts of email messages composed using the MIME (Multipurpose Internet Mail Extensions) specification. Without MIME types, email clients would not be able to understand if an attachment files was a PNG file or a spreadsheet and would not be able to show them in the appropriate way.

In addition to email clients, web browsers also support various media types. This enables the browser to display or output files that are not in HTML format. Media type specification is also an important information for search engines for the classification of data files on the web.

List of common media types

IANA manages a registry of media types and character encodings. The organization makes a list available to the public through the Web. Some of the more notable media types used on the Web are listed below:

Type application

For Multipurpose files:-

  • application/atom+xml: Atom feeds
  • application/ecmascript: ECMAScript/JavaScript; Defined in RFC 4329 (equivalent to application/javascript but with stricter processing rules)
  • application/EDI-X12: EDI X12 data; Defined in RFC 1767
  • application/EDIFACT: EDI EDIFACT data; Defined in RFC 1767
  • application/json: JavaScript Object Notation JSON; Defined in RFC 4627
  • application/javascript: ECMAScript/JavaScript; Defined in RFC 4329 (equivalent to application/ecmascript but with looser processing rules) It is not accepted in IE 8 or earlier - text/javascript is accepted but it is defined as obsolete in RFC 4329. The "type" attribute of the <script> tag in HTML5 is optional and in practice omitting the media type of JavaScript programs is the most interoperable solution since all browsers have always assumed the correct default even before HTML5.
  • application/octet-stream: Arbitrary binary data.[5] Generally speaking this type identifies files that are not associated with a specific application. Contrary to past assumptions by software packages such as Apache this is not a type that should be applied to unknown files. In such a case, a server or application should not indicate a content type, as it may be incorrect, but rather, should omit the type in order to allow the recipient to guess the type.[6]
  • application/ogg: Ogg, a multimedia bitstream container format; Defined in RFC 5334
  • application/pdf: Portable Document Format, PDF has been in use for document exchange on the Internet since 1993; Defined in RFC 3778
  • application/postscript: PostScript; Defined in RFC 2046
  • application/rdf+xml: Resource Description Framework; Defined by RFC 3870
  • application/rss+xml: RSS feeds
  • application/soap+xml: SOAP; Defined by RFC 3902
  • application/font-woff: Web Open Font Format; (candidate recommendation; use application/x-font-woff until standard is official)
  • application/xhtml+xml: XHTML; Defined by RFC 3236
  • application/xml-dtd: DTD files; Defined by RFC 3023
  • application/xop+xml:XOP
  • application/zip: ZIP archive files; Registered[7]
  • application/x-gzip: Gzip

Type audio

For Audio.

Type image

Type message

  • message/http: Defined in RFC 2616
  • message/imdn+xml: IMDN Instant Message Disposition Notification; Defined in RFC 5438
  • message/partial: Email; Defined in RFC 2045 and RFC 2046
  • message/rfc822: Email; EML files, MIME files, MHT files, MHTML files; Defined in RFC 2045 and RFC 2046

Type model

For 3D models.

Type multipart

For archives and other objects made of more than one part.

  • multipart/mixed: MIME Email; Defined in RFC 2045 and RFC 2046
  • multipart/alternative: MIME Email; Defined in RFC 2045 and RFC 2046
  • multipart/related: MIME Email; Defined in RFC 2387 and used by MHTML (HTML mail)
  • multipart/form-data: MIME Webform; Defined in RFC 2388
  • multipart/signed: Defined in RFC 1847
  • multipart/encrypted: Defined in RFC 1847

Type text

For human-readable text and source code.

  • text/cmd: commands; subtype resident in Gecko browsers like Firefox 3.5
  • text/css: Cascading Style Sheets; Defined in RFC 2318
  • text/csv: Comma-separated values; Defined in RFC 4180
  • text/html: HTML; Defined in RFC 2854
  • text/javascript (Obsolete): JavaScript; Defined in and obsoleted by RFC 4329 in order to discourage its usage in favor of application/javascript. However, text/javascript is allowed in HTML 4 and 5 and, unlike application/javascript, has cross-browser support. The "type" attribute of the <script> tag in HTML5 is optional and there is no need to use it at all since all browsers have always assumed the correct default (even in HTML 4 where it was required by the specification).
  • text/plain: Textual data; Defined in RFC 2046 and RFC 3676
  • text/vcard: vCard (contact information); Defined in RFC 6350
  • text/xml: Extensible Markup Language; Defined in RFC 3023

Type video

For video.

List of common media subtype prefixes

Prefix vnd

For vendor-specific files.

Prefix x

For non-standard files.

  • application/x-www-form-urlencoded Form Encoded Data; Documented in HTML 4.01 Specification, Section 17.13.4.1
  • application/x-dvi: device-independent document in DVI format
  • application/x-latex: LaTeX files
  • application/x-font-ttf: TrueType Font No registered MIME type, but this is the most commonly used
  • application/x-shockwave-flash: Adobe Flash files for example with the extension .swf
  • application/x-stuffit: StuffIt archive files
  • application/x-rar-compressed: RAR archive files
  • application/x-tar: Tarball files
  • text/x-gwt-rpc: GoogleWebToolkit data
  • text/x-jquery-tmpl: jQuery template data
  • application/x-javascript:
  • application/x-deb: deb (file format), a software package format used by the Debian project

Prefix x-pkcs

For PKCS standard files.

  • application/x-pkcs12: p12 files
  • application/x-pkcs12: pfx files
  • application/x-pkcs7-certificates: p7b files
  • application/x-pkcs7-certificates: spc files
  • application/x-pkcs7-certreqresp: p7r files
  • application/x-pkcs7-mime: p7c files
  • application/x-pkcs7-mime: p7m files
  • application/x-pkcs7-signature: p7s files

See also

References

  1. ^ "Internet Media Type registration, consistency of use". W3C. 2002-09-04. Retrieved 2012-02-29.
  2. ^ Freed, N. and Borenstein, N. (1996). "RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies". IETF. Retrieved 2006-11-29. {{cite web}}: Unknown parameter |month= ignored (help)CS1 maint: multiple names: authors list (link)
  3. ^ Freed, N.; Klensin, J.; Postel, J. (1996). "RFC 2048 - Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures, Section 2.1.2 - Vendor Tree". IETF. Retrieved 2011-12-05. {{cite web}}: Unknown parameter |month= ignored (help)CS1 maint: multiple names: authors list (link)
  4. ^ Freed, N.; Klensin, J. (2005). "RFC 4288 - Media Type Specifications and Registration Procedures". IETF. Retrieved 2008-06-14. {{cite web}}: Unknown parameter |month= ignored (help)CS1 maint: multiple names: authors list (link)
  5. ^ RFC 2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: Media types. Tools.ietf.org. Retrieved on 2010-09-29.
  6. ^ HTTP/1.1: Entity. W3.org. Retrieved on 2010-09-29.
  7. ^ MIME SUBTYPE NAME: zip
  8. ^ MIME SUBTYPE NAME: png
  9. ^ MIME subtype name : Vendor Tree - vnd.microsoft.icon
  10. ^ Quicktime
  11. ^ vnd.oasis.opendocument.text
  12. ^ vnd.oasis.opendocument.spreadsheet
  13. ^ vnd.oasis.opendocument.presentation
  14. ^ vnd.oasis.opendocument.graphics
  15. ^ "Application Media Types". IANA. Retrieved 2012-02-19.