Iis|mime| Tricks MIME (Multipurpose Internet Mail Extensions, multi-purpose Internet Message extensions) is created for e-mail exchange, network documentation, And the specification of file formats in the enterprise network and other applications on the Internet.
Each MIME format contains a MIME content type and a subtype indicating the data stored in this file. Each MIME type is made up of two parts, preceded by a large category of data, such as sound audio, image image, and so on, followed by the definition of a specific kind. MIME types and subtypes are generally listed in the form of type/subtype, such as the type "text/html" of the Web page.
In HTTP, the MIME type is defined in the Content-type header.
For example, set up you want to send a Microsoft Excel file to the client. Then the MIME type is "application/vnd.ms-excel". In most cases, the file will then be routed to execl for processing (assuming we set execl as an application to handle a particular MIME type).
In ASP, the method of setting MIME type is through the Response object's ContentType property.
In the earliest HTTP protocol, there was no additional data type information, all the transmitted data was interpreted by the client as Hypertext Markup Language HTML document, and in order to support multimedia data types, the HTTP protocol used the MIME data type information appended to the document to identify the data type.
MIME is a multi-mesh Internet Mail extension designed to provide additional multimedia data when sending e-mail messages, allowing mail clients to process them according to their type. When it is supported by the HTTP protocol, however, its significance is even more pronounced. It makes the HTTP transmission not only ordinary text, but become rich and colorful.
Common MIME Types
Hypertext Markup Language text. html,.html text/html
Plain text. txt Text/plain
RTF text. rtf Application/rtf
GIF graphics. gif image/gif
JPEG Graphics-ipeg,.jpg image/jpeg
Au sound file. Au audio/basic
Midi Music file Mid,.midi Audio/midi,audio/x-midi
RealAudio music files. RA,. Ram Audio/x-pn-realaudio
MPEG files. Mpg,.mpeg video/mpeg
AVI file. avi Video/x-msvideo
gzip files. GZ application/x-gzip
Tar file. Tar Application/x-tar
There is a dedicated organization of the IANA on the Internet to confirm standard MIME types, but the Internet is growing too fast for many applications to wait for the IANA to confirm that the MIME types they use are standard types. So they use the method of X-opening in the category to identify that the category has not yet become a standard, such as X-gzip,x-tar. The fact that these types are widely used has become a fact standard.
As long as both the client and the server recognize this MIME type, even if it is not a standard type, the client program can handle the data according to the MIME type using a specific processing method. For Web servers and browsers (including the operating system), the default is to set the standard and common MIME types, and only for unusual MIME types is it necessary to set up both the server and the client browser for identification.
Because the MIME type is related to the suffix of the document, the server uses the suffix of the document to differentiate between the MIME types of the different files, and the correspondence between the document suffix and the MIME type must be defined in the server. When the client receives data from the server, it simply accepts the data stream from the server and does not know the name of the document, so the server must use additional information to tell the client the MIME type of the data. Before the server sends the real data, it sends the MIME type of the flag data, which is defined using the Content-type keyword, for example, for HTML documents, where the server first sends the following two lines of MIME identity information, which is not part of the real data file.
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.