MIME and IIS 6

Source: Internet
Author: User
Tags microsoft help

1. What is MIME?
2. What is the MIME type?
Iii. solve the problem that the win2003 server cannot download files such as iso exe rmvb
4. Microsoft Help document: http://www.microsoft.com/china/TechNet/iis/mimeiis.asp

1. What is MIME?
Users can use MIME to set the server to transmit multimedia such as sound and animation information, which may be done through CGI scripts. In the following article, you can learn about MIME and how to use MIME on the network.
MIME is a technical specification. It was originally used for email, and can now be used in a browser to transmit information that can be recognized by the browser. It is very difficult to understand MIME knowledge, there are some basic
The concept of computer can be understood, but if you want to further use, you must pay attention to the content. In fact, we have reached the MIME when surfing the Internet, but the browser and server are implemented at the underlying layer.
MIME is sometimes incorrectly resolved as Multimedia Internet Mail Extension (Multimedia Internet Mail)
Extensions), this is an error, but MIME is often used in multimedia applications on the Internet, so people think it is a multimedia mail extension, but in fact it should be called a multi-purpose
Internet Mail Extension (Multipurpose Internet Mail
Extensions), this 1.1 must be noted, because sometimes there is no non-text component in the content.
MIME is a huge extension to the mail system, because before MIME appeared, if the mail content needs to include sound and animation, it must be converted into ASCII code or binary information can be transferred.
The receiver must be decoded to obtain sound and picture information. MIME provides a method for attaching multiple encoding files to an email. This is very different from the original email.
Now MIME has become part of the HTTP protocol standard.
MIME is the main method used by the server to notify the client of the type of file to be transmitted. The client browser also tells the server its parameters through MIME. On the Internet, if the received file does not have a MIME header
The default format is HTML. But this is also not good, because when the MIME header is text/plain, the browser will directly display the text, color, and other parameters, so that the display
The content is not very nice.
What the MIME header looks like depends on whether it is used in an email or in a browser. The content of the two may be different. For the mail header, the version number, content type declaration, encoding method, and content description are essential. This is the format used in the mail header. Below, we will focus on Transmitting the MIME header in HTTP. At this time, the MIME header should be simpler.
The following example shows the standard MIME header of an email:

Mime-Version: 1.0 // Version: 1.0

Content-Type: multipart/mixed; boundary = "IMA. Boundary.750407228" // There are many Content types

-IMA. Boundary.750407228

Content-Type: text/plain; charset = US-ASCII // Content Type: text, character is ASCII

Content-Transfer-Encoding: 7bit // Encoding method: 7 bits

Content-Description: cc: Mail note part

When used in browsers, users do not need to know so much information, so the MIME header is relatively simple. When you access a webpage, a session is generated between the browser and the server as one of the request content.
In part, the browser sends a description of the MIME type that it can understand, which tells the server what the browser can support in addition to the webpage. The server generally does not modify this information.

The server sends the client's MIME header to notify the client of the content in the browser. Let's look at the following header:

Content-type: text/html

During implementation, you must note that the MIME header must be followed by an empty line. Otherwise, the header will be ignored by the browser and displayed as text. When the server sends a GIF image, the header is as follows:

Content-type: image/gif
Content-transfer-encoding: BINARY

Generally, the MIME content type does not play any role. The browser can identify the content type by itself. However, if you use other types, this problem will be very serious. If you use
Text/postscript, then the browser will display the download window, or display this thing, it will be difficult to do. Next we will introduce the standard MIME type.

Text. Text, which is used to describe different types of Text, including common Text, PostScript, and HTML, although HTML is not a possible subtype.

Multipart. Multiple types, indicating that this information includes multiple types of information.

Message. Used to mark different types of messages.

Application. Application type.

Image. Image, used to indicate the Image file.

Audio. specifies the Audio file.

Video. Image, used to indicate an animated file.

Each MIME type has a different subtype. In fact, you cannot use the type independently instead of the subtype. There is only one exception, which is the "telnet" type. IANA provides 45 types
Type/child type pairs are supported. Of course, the standard is open, allowing users to customize their own types. User-defined types should start with "X-" to show differences. When adding a new type, be sure to use
Some types achieve their own goals. To add a new type, ensure that the server side supports this type, and ensure that the client can also identify the new type through some applications (such as plug-ins. If
Your website has a wide range of visitors. Do not use new types easily, either use existing types, or submit a registration request to IANA.

2. What is the MIME type?

When the output result is sent to the browser, the browser must start a party application to process the 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 transmit a Microsoft
Excel file to the client. The MIME type is "application/vnd. ms-excel ". In most cases, this file is then transmitted
Execl to process (Suppose we set Execl to process applications of special MIME types ). In ASP, the method for setting the MIME type is through the Response object
ContentType attribute.

Multimedia file format MIME

In the earliest HTTP protocol, there was no additional data type information. All transmitted data was interpreted by the client program as HTML documents in the hypertext markup language. to support multimedia data types, the MIME data type information appended to the document is used in the HTTP protocol 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 types

Hypertext markup language text .html, .html text/html
Common 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 files 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

There is a dedicated IANA organization in the Internet to confirm the standard MIME type, but the Internet is growing too fast and many applications cannot wait for IANA to confirm what they are using
The MIME type is standard. 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 very useful.
Widely used and has become a 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 adopt a specific location based on the MIME type.
Processing data. In Web servers and browsers (including operating systems), standard and common MIME types are set by default.
MIME type, you need to set the server and client browser at the same time 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 corresponding relationship between the document suffix and the MIME type.
System. 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.
Type. Before the server sends real data, it must first send the MIME type information of the Flag data, which is defined by the Content-type keyword. For example
The server will first send the following two lines of MIME identification information, which is not part of the real data file.

Content-type: text/html

Note that the second act is a blank line, which is required to separate the MIME information from the real data content.

Iii. solve the problem that the win2003 server cannot download iso/exe/rmvb and other files

---------------------------

Today, a friend helped maintain the flydown and told me that the uploaded Kingsoft Mac cannot be downloaded. I checked that it was a. ISO file. This problem was not solved on the win2000 Server. You can download files such as zip rar iso in http mode.

Now change to win2003, download zip rar and so on, and do not pay attention to iso. Now we find that the iso file cannot be downloaded, And the download path must be correct. It should be because IIS is under security consideration and has not registered ISO.

Solution: Open IIS, select the server, right-click, and the property contains the MIME type,

Add Extension:. iso

Type: application

OK!

You can also set the website separately: website-> properties-> HTTP header-MIME type

Add Extension:. iso

Type: application

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.