What is MIME type?

Source: Internet
Author: User
What is the MIME type-when the output result is sent to the browser, the browser must start the application Program To process this output document. This can be done through multiple types of mime (multi-function Internet Mail Extension protocol. In HTTP, the MIME type is defined in the Content-Type header. For example, you need to transfer a Microsoft Excel file to the client. The MIME type is "application/vnd. MS-excel ". In most cases, this file is then transmitted to execl for processing (assuming we set execl to an application that handles special MIME types ). In ASP, the method for setting the MIME type is through the contenttype attribute of the response object. In the earliest HTTP protocol of mime in multimedia file format, there is no additional data type information. All transmitted data is interpreted by the client program as HTML documents in hypertext markup language, to support multimedia data types, the MIME data type information appended to the document is used in HTTP to identify the data type. Mime is an extension of multi-object Internet mail. It is designed to attach multimedia data to an email so that the mail client program can process it based on its type. However, when it is supported by the HTTP protocol, its meaning becomes more significant. It makes HTTP transmitted not only plain text, but also rich and colorful. Each MIME type consists of two parts. The front part is a large data type, such as audio, image, and so on. The latter part defines a specific type. Common mime-type hypertext markup language text .html, .html text/html plain text. TXT text/plain RTF text. RTF application/rtf gif image. GIF image/gif jpeg image .ipeg,.jpg image/JPEG au audio file. AU audio/basic MIDI music file mid ,. MIDI audio/Midi, audio/X-Midi RealAudio music file. ra ,. ram audio/X-PN-RealAudio mpeg file. mpg ,. MPEG Video/mpeg avi file. AVI Video/X-msvideo GZIP file. GZ application/X-gzip tar file. tar application/X-tar Internet has a dedicated organization IANA to confirm the standard MIME type, The Internet is growing too fast, and many applications cannot wait for IANA to confirm that the MIME type they use is of the standard type. Therefore, they use methods starting with X-in the category to identify this category, such as X-gzip and X-tar. In fact, these types are widely used and have become the de facto standard. As long as the client and server acknowledge this mime type together, even if it is not a standard type, the client program can process data according to the MIME type. In web servers and browsers (including operating systems), standard and common MIME types are set by default, the server and client browser must be set for identification. Because the MIME type is related to the document suffix, the server uses the document suffix to distinguish the MIME types of different files. The server must define the correspondence between the document suffix and the MIME type. When a customer program receives data from the server, it only accepts data streams from the server and does not know the document name. Therefore, the server must use additional information to tell the customer program the MIME type of data. Before the server sends real data, it must first send the MIME type information of the Flag data. This information is defined using the Content-Type keyword. For example, for HTML documents, the server will first send the following two lines of mime identification information, which is not part of a real data file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.