What are MIME types?

Asked

Viewed 4,066 times

17

What are MIME types ?

And what is its importance for correctly rendering pages/files?

Its use is mandatory or depends on the browser ?

If undeclared, browsers may assume a different behavior at the time of processing?

Example:

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

but it also works like this:

<script></script>
  • 1

    Here has a very objective and effective explanation on the subject (it is in English).

2 answers

20


Multipurpose Internet Mail Extensions. It is a standard used to indicate how content in an email message should be treated, such as:

  • encoding used,
  • data format,
  • split
  • and other specific information.

Without this information the software that will interpret it does not know how to treat properly (it could even make an analysis of the content, but not all cases this 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 how to handle, or an external software, etc.).

Today MIME is used for protocols other than those used for e-mail.

MIME can contain several information the best known is the content type.

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

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 MIME version, metadata and how the content is inserted (Content Disposition) and coding (Content-Transfer-Encoding).

Wikipedia article.

List of mimes "recognized" by IANA.

Some browsers can decide for themselves what to do with some content, as is the case of script Javascript. But the default requires it to be used. And yes, if it is outside the standard, the browser can assume unexpected behavior.

7

MIME stands for Multi-purpose Internet Mail Extensions. MIME types form a standard file type classification on the Internet. Internet programs such as web servers and browsers all have a list of MIME types, so that they can transfer files of the same type in the same way, 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 bar. 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: http://www.aibn.com/help/Learn/mimetypes.html

Browser other questions tagged

You are not signed in. Login or sign up in order to post.