A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service
// Specify a stream that cannot be read by the client and must be downloaded.
Response. contenttype = "application/X-msdownload ";
The MIME type is the type used by an application to open a file with a certain extension. When a file with the extension is accessed, the browser automatically opens the file with the specified application. It is used to specify custom client file names and open media files.
The full name of mime is "Multipurpose Internet Mail
Extensions "multi-function Internet
The Mail Extension Service is a multi-purpose Internet Mail Extension protocol. It was first used in the e-mail system in 1992, but later used in browsers. The server will tell the type of multimedia data they send
Browser, and the notification means to describe the MIME type of the multimedia data, so that the browser can know the received information which are MP3 files and shockwave files. Server Load balancer
The mime token is placed in the transmitted data to tell the browser which plug-in is used to read the relevant file.
Mime supports mail messages in multiple formats, including non-ASCII characters and binary format attachments. This standard is defined in;
RFC 2045,; RFC 2046,; RFC 2047,; RFC 2048, and RFC 2049. By RFC
2822. It is stipulated that the email standard does not allow the use of characters other than the 7-bit ASCII character set in mail messages. For this reason, non-English message and binary files, images, sounds, and other non-text Cancellation
Messages cannot be transmitted in emails. Mime specifies a symbolic method used to represent a variety of data types.
After the browser receives the file, it will go to the plug-in system to find out which plug-in can identify and read the received file. If
The browser does not know which plug-in system to call. It may tell the user that a plug-in is missing, or directly selects an existing plug-in to try to read the received file, which may cause the system to crash. Missing information transmitted
It is difficult to estimate the situations that may result from fewer mime identifiers, because some computer systems may not have any faults, but some computers may crash.
To check whether a server correctly sets the MIME type, follow these steps:
1. Open the server webpage in the Netscape Browser
2. Go to the "View" menu and select "Page Info"
3. Click "embed" in the upper-layer framework in the pop-up window"
Check whether the MIME type is "application/X-director" or "application/X-Shockwave-
Flash ", if the above information indicates that the server has correctly set the MIME type, and if the MIME type lists text content, eight-bit data, or other forms, it indicates that the server
The MIME type is not set correctly.
If the server does not correctly indicate the type of data it sends, the server administrator should correctly add relevant information. The specific operation method is very simple and quick.
Microsoft uses ActiveX controls in Windows browsers instead
Netscape plug-in, which does not rely on mime encoding as other browsers do. The "CLSID" attribute of the "object" tag accurately identifies the program to be called to read
Therefore, the browser does not have to select a reader as the "embed" tag. Because of this, you will often encounter mime problems when using a browser with plug-ins.
ActiveX controls are rarely used in browsers.
Because of the differences in the above work methods, I wonder if you find that you are playing in the Netscape Browser.
When a WAV file is used, the browser calls the liveconnect plug-in to play the file. other browsers generally use the general QuickTime plug-in to play the file. This is because
The Netscape Browser needs to read the mime identifier to determine which program to call to read the received file, and the server sets to play the wav file in the Netscape Browser.
The liveconnect plug-in should be used, so the Netscape browser will call the liveconnect plug-in when receiving files in WAV format, but because other browsers do not
In this way, they all use the default player for playing wav files. Of course, flash movie files do not have this problem, because only Flash players can correctly read this
When sending the output result to a browser, the browser must start an appropriate 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, assume that you want to transmit
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
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. 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 evolving
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. For example
For example, 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
It does not matter. The customer program can process data according to the MIME type. In web servers and browsers (including operating systems), standard and common
MIME type. Only for uncommon MIME types, you must 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 correspondence between the document suffix and the MIME type. When the client program receives data from the server, it only accepts data streams from the server and does not know the document name.
You must use additional information to indicate the MIME type of the client program data. Before the server sends real data, it must first send the MIME type information of the Flag data.
The Content-Type keyword is defined. For example, for an HTML document, the server will first send the following two lines of mime identification information, which is not part of a real data file.
Note that the second act is a blank line, which is required to separate the mime information from the real data content.
Mime utilizes the fact that RFC
822 the message body contains only simple ASCII text. Therefore, mime information is composed of normal Internet Text emails, text emails
It has some special information headers that comply with RFC 822 and formatted Information bodies (using ASCII
). These MIME headers provide a special way to indicate attachments in the mail.
Mime Information Analysis
The information of a common text mail contains a header (to: From: Subject:
And so on.
Mr .., and so on ). It is not surprising that a message header is contained in a mime-compliant message. Each part of the message is called a mime segment, and each segment is prefixed with a special header. Mime mail is only a base
An extension of RFC 822 mail. However, it has its own RFC specification set.
Based on the position in the package, the MIME header is generally divided into the mime information header and the mime field header. (TRANSLATOR: the MIME header refers to the entire mail header, while the MIME header is only the header of each mime segment .)
Mime information headers include:
This header provides the MIME Version Number used. This value is 1.0.
It defines the data type so that the data can be processed properly. Valid types include: text,
Image, audio, video,
Applications, multipart, and message. Note that any binary attachment should be called application/octet-
Stream. Some examples of this header are: image/jpg,
Application/mswork, multipart/mixed, which is only a small part.
This is the most important one in all headers, because it describes the encoding method for data.
The user/Mua will use it to decode the attachment. For each attachment, you can use 7bit, 8bit,
, Quoted-printable, base64, or custom. 7-bit encoding is used in us
A common encoding method in the ASCII character set, that is, keep it as it is. 8-bit and binary encoding are generally not used. Standard text that is readable to humans.
The quoted printable can be used to protect the gateway.
. Base64 is a common method. When you need to decide which encoding method to use, it provides a free-of-charge option. It is usually used in binary and non-text data. Note that any non-7bit
The data must be encoded in one mode so that it can be passed through the Internet Mail Gateway!
If the Content-Type is message/external-body or multipart/alternative
Header. It is beyond the scope of this article.
This is an optional Header. It is a free text description of any information segment. The description must use the US-ASCII code.
A pilot header that provides a prompt to the customer Program/Mua to determine whether to display the attachment within the row or as a separate attachment.
Mime field header (the header that appears in the actual mime attachment part). Besides the mime-version header
There are any of the above header fields. If a MIME header is part of an information block, it acts on the entire information body. For example, if content-transfer-encoding is displayed in
It is applied to the entire information body, but if it is displayed in a mime segment, it "can only" be used in that segment.
Note: It can automatically decrypt the received emails.
The format is followed by the suffix name, followed by the corresponding MIME type (for example, rar application/X-Rar-compressed indicates. rar corresponds to application/X-Rar-compressed)
EMB chemical/X-embl-DL-nucleus otide
Embl chemical/X-embl-DL-nucleus otide
Jad text/vnd. Sun. J2EE. app-Descriptor
Nmapplication/vnd. mpohun. Certificate
MPN application/vnd. mophun. Application
MPP application/vnd. MS-Project
Nokia-op-logo image/vnd. Nok-oplogo-color
Pot Application/vnd. MS-PowerPoint
PPS Application/vnd. MS-PowerPoint
PPT application/vnd. MS-PowerPoint
Qcp audio/vnd. qcelp
R3t text/vnd. rn-realtext3d
RDF application/RDF + XML
RF image/vnd. Rn-realflash
Rnx application/vnd. Rn-RealPlayer
RP image/vnd. Rn-realpix
RT text/vnd. Rn-RealText
RV video/vnd. Rn-realvideo
Si7 image/vnd. stiwap. Sis
Si9 image/vnd. lgtwap. Sis
SIS application/vnd. Symbian. Install
THM application/vnd. Eri. THM
Wbmp image/vnd. WAP. wbmp
Web application/vnd. xara
WML text/vnd. WAP. WML
Wmlc application/vnd. WAP. wmlc
WMLS text/vnd. WAP. WMLScript
Wmlsc application/vnd. WAP. wmlscriptc
WMLScript text/vnd. WAP. WMLScript
WS text/vnd. WAP. WMLScript
WSC application/vnd. WAP. wmlscriptc
Xar application/vnd. xara
Xdw application/vnd.fujixerox.doc uworks
Xht application/XHTML + XML
Xhtm application/XHTML + XML
XHTML application/XHTML + XML
Xla application/vnd. MS-Excel
Xlc application/vnd. MS-Excel
XLM application/vnd. MS-Excel
XLS application/vnd. MS-Excel
Xlt application/vnd. MS-Excel
Xlw application/vnd. MS-Excel
Start building with 50+ products and up to 12 months usage for Elastic Compute Service