Initially, MIME types were designed to transmit data other than text. Actually it was for email. For example, to transfer a picture, through its protocol, the MIME type was used, which reports that, for example, a JPEG file is being transmitted.
The development of technology and its appearance
MIME types are actively used for data transfer in the HTTP protocol. In simple terms, it describes the additional attributes of a forwarded packet and supports the ability to implement the transfer of multiple files, even nested within one message. In order to inform the addressee about what type of file is being transmitted, and, accordingly, how to work with it, its MIME type is added to the header. For example, plain text is labeled text / plain, and electronic pages are labeled text / html.
Why do you need to know about MIME?
Web developers and programmers, whose responsibilities include creating products that somehow work with the Network, need to know how MIME types are arranged and why. It is better to describe the interaction using an example closer to reality.
A web programmer writes code for one of the pages on the site. It allows you to download a PDF file. At the same time, in the code, it indicates MIME for this data type: application / pdf. The browser, referring to this page, reads the title and realizes that it is a PDF file. And depending on the settings, it either immediately starts downloading it, or simply opens it for viewing in a window. Thus, the separation of content into types allows the client to adequately respond to incoming data types in an appropriate way.
List of MIME Types
The number of file varieties listed in the MIME standard is large. For convenience, they are all divided into categories. It is worth considering the main ones and describing the types, as well as how the browser will respond to them.
Category text
It contains types that are somehow related to the transmission of textual information. This may include scripts, style sheets, plain text. The category includes:
- Html Hypertext Markup Language. No site on the Internet can work without using it.
- Css. Cascading style sheets. Design and interaction of objects on the page is carried out using such files.
- Javascript Upon seeing this type, the browser will immediately understand that it needs to process a section of code - a script.
- Plain Simple plain text.
- Xml XML markup files.
Category image
Here extensions of the transferred files are transferred, for example such:
Application category
It contains types that can be run one way or another, that is, data from some applications or services. The reaction of the browser to some of them may be a request to launch a special program or open it directly on the page.
- Json Convenient data transfer format. Tells the browser that the response will be passed to json.
- Pdf. Depending on the browser settings, this type can be downloaded, viewed in a window, or use a third-party program installed on the computer.
- Zip and gzip. Transfer archive files.
- Ogg. Designation for multimedia content.
- Xhtml + xml. An XHTML data transfer format that complements and enhances the functionality of classic HTML, and also brings XML performance to the standard.
Audio Category
By analogy with graphic files, extensions are mainly transferred in this category:
- Basic The standard type of sound file.
- Aac. The format of the audio file.
- Mpeg. Here mp3 or mpeg can be transmitted.
- X-ms-wma or x-ms-wax. Windows Media Audio data type.
- Webm. Quite a young video format developed by Google. Already supported by many browsers and media players.
X
X types belong to the category application. Using them, non-standard file types are indicated. These include, for example, archives tar, RAR, FLASH and many others that are not included in the main list.
Conclusion
The list of MIME type is constantly expanding due to the advent of new technologies, standards and file types. The current list can be found in the latest updates to RFC documents regarding MIME types.