What are MIME types?

15

What are MIME types?

And how important is it for rendering pages / files correctly?

Is your use mandatory or depends on your browser?

If not declared, can browsers behave differently at treatment time?

Example:

<script type='text/javascript'></script>

but also works like this:

<script></script>
    
asked by anonymous 13.11.2015 / 13:25

2 answers

18

Multipurpose Internet Mail Extensions. It is a standard used to indicate how content in an e-mail message should be handled, such as, encoding used, data format, part separation, and other specific information. Without this information the software that will interpret it does not know how to treat properly (it could even do an analysis of the content, but not all cases would be possible and would be much more complicated). In general this will route the content to a specific part of the software (a engine renderer, a language interpreter, a plugin , a specific action that the client knows to manipulate, or a external software, etc.).

MIME is now used for protocols other than those used for email.

MIME can contain various information. The most well-known is content type .

What was used in the example is a content type . He makes it clear to the browser that this is a script written in the JavaScript language and should call his interpreter and delegate what to do with it.

The first part indicates that the content is pure text. It could be another type of media or application (to be called), for example. The second part is more specific indicating how it should be interpreted.

Other commonly used information is the version of MIME, metadata and how content is inserted ( Content Disposition ) and Encoding ( Content-Transfer-Encoding / p>

Wikipedia article .

List of MIMEs "recognized" by IANA .

Some browsers can decide on their own what to do with some content, such as script JavaScript. But the standard requires it to be used. And yes, if it is out of the standard, the browser may assume an unexpected behavior.

    
13.11.2015 / 13:37
7

MIME stands for Multi-purpose Internet Mail Extensions. MIME types form a classification pattern for file types on the Internet. Internet programs such as Web servers and browsers all have a list of MIME types, so they can transfer files of the same type, likewise no matter which operating system they are working on.

A MIME type has two parts: a type and a subtype. They are separated by a slash. For example, the MIME type for Microsoft Word files is application and the subtype is msword. Together, the full MIME type is application / msword.

Source: link

    
13.11.2015 / 13:36