![]() The functions described below provide the primary interface for this module. Theįunctions are the normal interface to this module, but some applications may be ![]() The module provides one class and a number of convenience functions. To MIME type and from MIME type to filename extension encodings are not The mimetypes module converts between a filename or URL and the MIME typeĪssociated with the filename extension. The discrete types currently registered with the IANA are: applicationĪny kind of binary data that doesn't fall explicitly into one of the other types Įither data that will be executed or interpreted in some way or binary data that requires a specific application or category of application to use.Mimetypes - Map filenames to MIME types ¶ There are two classes of type: discrete and multipart.ĭiscrete types are types which represent a single file or medium, such as a single text or music file, or a single video.Ī multipart type represents a document that's comprised of multiple component parts, each of which may have its own individual MIME type or, a multipart type may encapsulate multiple files being sent together in one transaction.įor example, multipart MIME types are used when attaching multiple files to an email. The parameter values can be case-sensitive. MIME types are case-insensitive but are traditionally written in lowercase. To specify a UTF-8 text file, the MIME type text/plain charset=UTF-8 is used. If no charset is specified, the default is ASCII ( US-ASCII) unless overridden by the user agent's settings. A MIME type always has both a type and a subtype, never just one or the other.Īn optional parameter can be added to provide additional details: type/subtype parameter=valueįor example, for any MIME type whose main type is text, you can add the optional charset parameter to specify the character set used for the ics) files.Įach type has its own set of possible subtypes. The subtype identifies the exact kind of data of the specified type the MIME type represents.įor example, for the MIME type text, the subtype might be plain (plain text), html ( HTML source code), or calendar (for iCalendar/. The type represents the general category into which the data type falls, such as video or text. ![]()
0 Comments
Leave a Reply. |