Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MIME-type conventions, standards or limitations?

Given a new, proprietary file format that cannot currently be handled by any known application, I assume you can just invent a new MIME type value as follows:

Content-Type: application/my-arbitrary-format

Assuming this is the way to go, are there any limitations (format, syntax, length, reserved words, or otherwise), standards (IETF, ISO, W3C, IEEE, etc), or conventions (like the slash type/format)?

Note that I do NOT want to use a known MIME type value, because the browser and/or OS should not make assumptions about what can or cannot open the file.

like image 526
Dolph Avatar asked Jul 08 '10 15:07

Dolph


People also ask

What is MIME type specification?

A media type (also known as a Multipurpose Internet Mail Extensions or MIME type) indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

Are MIME types case sensitive?

MIME types are case insensitive. They are lowercase by convention only. RFC 2045 says: "The type, subtype, and parameter names are not case sensitive." If you have a MIME type of text/plain that's a type of text and a subtype of plain . So, per the spec, these are not case sensitive.

How are MIME types determined?

MIME types are defined by three attributes: language (lang), encoding (enc), and content-type (type). At least one of these attributes must be present for each type. The most commonly used attribute is type. The server frequently considers the type when deciding how to generate the response to the client.


2 Answers

This page gives conventions for naming MIME types. Here is the section about Custom MIME Types:

  • Use x. as prefix to the subtype for experimental MIME types. Note that the x- prefix is also valid for this purpose, but is discouraged in favor of x. to promote symmetry with other prefixes.

  • Use vnd. as prefix to the subtypte for vendor specific MIME types which are part of a commercial product. The vnd. prefix should be followed by the vendor name and subtype separated by a period (e.g. application/vnd.mozilla.xul+xml).

  • Use prs. as prefix to the subtype for personal/vanity MIME types which aren't part of a commercial product.

like image 163
Cory Klein Avatar answered Sep 27 '22 18:09

Cory Klein


To do this correctly, you can register your new type with IANA. http://www.iana.org/assignments/media-types/

like image 43
Brad Avatar answered Sep 27 '22 19:09

Brad