Skip to content
Related Articles

Related Articles

MIME Media Types

View Discussion
Improve Article
Save Article
  • Last Updated : 03 Nov, 2021

MIME media types basically stand for Multipurpose Internet Mail Extension media types. These media types were originally created to make emails include information other than only plain text. These media types show us the following things: 
 

  1. How text and attachment are combined into a single message or email.
  2. How different items are encoded for transmission. 
     

MIME basically extends the format of email to: 
 

  1. Text in character sets other than ASCII
  2. Header information in non-ASCII character sets
  3. Attached is information other than plain text such as audio, video, application programs, etc. 
     

In today’s scenario, it is not only used by emails it is also used by many web servers in a way to tell the web browser what type of data is sent to them. 

MIME basically consists of two parts.  

  1. Main type
  2. Subtype 
     

These are further structured into trees. The main type separates the sub-type by a slash. 

Examples of Main types: 

application, audio, font, image, message, text 

Examples of Subtypes:  

html, xml, zip, pdf, xls 

Some common examples of media types are as follows:  

1. application/json
2. audio/mpeg
3. text/pdf 

Here before the slash is the main type and after the slash is the subtype. 

The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. 

Content-Disposition – 
Original MIME specification only describes the structure of mail without any presentation style. But the addition of the Content-Disposition Header describes the structure of mail-in presentation styles. A MIME part can have the following parts. 
 

  1. An inline content-disposition
  2. An attachment content-disposition 
     

The following example is taken from RFC 2183, where the header is defined: 

Content-Disposition: attachment; filename=genome.jpeg;
  modification-date="Wed, 12 Feb 1997 16:29:51 -0500"; 

The filename may be encoded as defined by RFC 2231. In HTTP, the Content-Disposition: attachment response header is usually used to hint to the client to present the response body as a downloadable file. 

While receiving such a response, a Web browser will prompt the user to save its content as a file rather than displaying it as a page in a browser window, with the filename parameter it suggests the default file name.
 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!