Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the MIME types in html

2025-03-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly talks about "what are the types of MIME in html". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the MIME types in html"?

In html, the MIME type refers to the multi-purpose Internet mail extension type, which is the type in which a file with a certain extension is opened by an application, and when the extension file is accessed, the browser automatically opens it using the specified application.

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

First, we need to understand how browsers handle content. The contents displayed in the browser include HTML, XML, GIF, and Flash. So how do browsers distinguish between them and decide what content is displayed in what form? The answer is MIME Type, which is the media type of the resource.

MIME (Multipurpose Internet Mail Extensions) Multipurpose Internet Mail extension type. Is the type of way in which a file with a certain extension is opened by an application, and when the extension file is accessed, the browser automatically opens it using the specified application.

To put it simply, MIME type is to tell the browser what form to display.

Description: MIME Type is used for data transmission on the Internet.

Multimedia file format MIME

In the earliest HTTP protocol, there was no additional data type information, and all the transmitted data were interpreted as hypertext markup language HTML documents by client programs. In order to support multimedia data types, MIME data type information appended to the document was used to identify data types in HTTP protocol.

MIME, which means multi-purpose Internet mail extension, was originally designed to attach multimedia data when sending e-mail, so that mail clients can process it according to its type. However, when it is supported by the HTTP protocol, its significance becomes more significant. It makes HTTP not only transmit ordinary text, but also become rich and colorful.

Each MIME type consists of two parts, preceded by a large category of data, such as sound audio, image image, and so on, followed by a specific category.

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 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 special organization in Internet, IANA, to identify standard MIME types, but Internet is growing so fast that many applications can't wait for IANA to confirm that the MIME type they use is standard. So they use the method that starts with x-in the category to indicate that the category has not yet become a standard, for example: xmurgzipdyxMurtar and so on. In fact, these types are widely used and have become the de facto standard. As long as the client and server recognize this MIME type, even if it is a non-standard type, the client program can use specific processing methods to process the data according to the MIME type. In Web servers and browsers (including operating systems), standard and common MIME types are set by default, and only for uncommon MIME types, both server and client browsers need to be set for identification.

Because the MIME type is related to the suffix of the document, the server uses the suffix of the document to distinguish the MIME types of different files, and the correspondence between the document suffix and the MIME type must be defined in the server. When the client program receives data from the server, it only receives 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 must send the MIME type information of the flag data, which is defined by the Content-type keyword. For example, for the HTML document, 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 behavior is a blank line, which is necessary, which is used to separate the MIME information from the actual data content.

MIME (Multipurpose Internet Mail Extensions) is an Internet standard that describes the type of message content.

MIME messages can contain text, images, audio, video, and other application-specific data.

The official MIME information is provided by Internet Engineering Task Force (IETF) in the following document:

RFC-822 Standard for ARPA Internet text messages

RFC-2045 MIME Part 1: Format of Internet Message Bodies

RFC-2046 MIME Part 2: Media Types

RFC-2047 MIME Part 3: Header Extensions for Non-ASCII Text

RFC-2048 MIME Part 4: Registration Procedures

RFC-2049 MIME Part 5: Conformance Criteria and Examples

Different applications support different MIME types.

At this point, I believe you have a deeper understanding of "what are the MIME types in html?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report