![]() om_extension?( ".cr") # => "text/crystal" MIME. usr/share/misc/mime.types # OpenBSD Registering custom MIME typesĪpplications can register their own MIME types: require "mime" om_extension?( ".cr") # => nil MIME.extensions( "text/crystal") # => Set(String).new MIME.register( ".cr", "text/crystal") An Internet media type, originally called a MIME type after MIME (Multipurpose Internet Mail Extensions) and sometimes a Content-type after the name of a. usr/local/etc/httpd/conf/mime.types # Apache 1.2 These values override those from DEFAULT_TYPES. On a POSIX system, the following files are tried to be read in sequential order, The Multipurpose Internet Mail Extensions, known also as MIME type, is a specification extending the format of email to support sending images, audio/video. Discrete types are types which represent a single file or medium, such as a single text or music file, or a single video. Types There are two classes of type: discrete and multipart. The registry will be populated with some default values (see DEFAULT_TYPES)Īs well as the operating system's MIME database.ĭefault initialization can be skipped by calling MIME.init(false) before the first MIME types are case-insensitive but are traditionally written in lowercase, with the exception of parameter values, whose case may or may not have specific meaning. require "mime" om_extension( ".html") # => "text/html" om_filename( "path/file.html") # => "text/html" This module implements a global MIME registry. A media type is composed of at least two parts: a type, a subtype, and one or more optional parameters. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |