甚么是 MIME TYPE MIME

2020-11-01 16:02 jianzhan
甚么是 MIME TYPE?

1、最先,大家要掌握访问器是怎样解决內容的。在访问器中显示信息的內容有 HTML、有 XML、有 GIF、也有 Flash ……那末,访问器是怎样区别它们,决策甚么內容用甚么方式来显示信息呢?回答是 MIME Type,也便是该資源的新闻媒体种类。

新闻媒体种类一般是根据 HTTP 协议书,由 Web 服务器告之访问器的,更精确地说,是根据 Content-Type 来表明的,比如:

Content-Type: text/HTML

表明內容是 text/HTML 种类,也便是超文字文档。为何是“text/HTML”而并不是“HTML/text”或其他甚么?MIME Type 并不是本人特定的,是历经 ietf 机构商议,以 RFC 的方式做为提议的规范公布在网络上的,大多数数的 Web 服务器和客户代理商都会适用这个标准 (顺带说1句,Email 附件的种类也是根据 MIME Type 特定的)。

一般仅有1些在互联网技术上得到普遍运用的文件格式才会得到1个 MIME Type,假如是某个顾客端自身界定的文件格式,1般只能以 application/x- 开始。

XHTML 更是1个得到普遍运用的文件格式,因而,在 RFC 3236 中,表明了 XHTML 文件格式文档的 MIME Type 应当是 application/xHTML+XML。

自然,解决当地的文档,在沒有人告知访问器某个文档的 MIME Type 的状况下,访问器也会做1些默认设置的解决,这将会和你在实际操作系统软件中给文档配备的 MIME Type 相关。例如在 Windows 下,开启申请注册表的“HKEY_LOCAL_MACHINESOFTWAREClassesMIMEDatabaseContent Type”主键,你能够看到全部 MIME Type 的配备信息内容。

2、在把輸出結果传输到访问器上的情况下,访问器务必起动适度的运用程序流程来解决这个輸出文本文档。这能够根据多种多样种类MIME(智能网际电子邮件扩充协议书)来进行。在HTTP中,MIME种类被界定在Content-Type header中。

比如,架设你要传输1个Microsoft Excel文档到顾客端。那末这时候的MIME种类便是“application/vnd.ms-excel”。在大多数数具体状况中,这个文档随后将传输给Execl来解决(假定大家设置Execl为解决独特MIME种类的运用程序流程)。在ASP中,设置MIME种类的方式是根据Response目标的ContentType特性。


多新闻媒体文档文件格式MIME

最开始的HTTP协议书中,并沒有额外的数据信息种类信息内容,全部传输的数据信息都被顾客程序流程解释为超文字标识語言HTML 文本文档,而以便适用多新闻媒体数据信息种类,HTTP协议书中就应用了额外在文本文档以前的MIME数据信息种类信息内容来标志数据信息种类。

MIME意为多目Internet电子邮件拓展,它设计方案的最开始目地是以便在推送电子器件电子邮件时额外多新闻媒体数据信息,让电子邮件顾客程序流程能依据其种类开展解决。但是当它被HTTP协议书适用以后,它的实际意义就更加明显了。它使得HTTP传送的不但是一般的文字,而变得丰富多彩多彩。

每一个MIME种类由两一部分构成,前面是数据信息的大种别,比如响声audio、图像image等,后边界定实际的类型。

普遍的MIME种类

超文字标识語言文字 .html,.html text/html
一般文字 .txt text/plain
RTF文字 .rtf application/rtf
GIF图型 .gif image/gif
JPEG图型 .ipeg,.jpg image/jpeg
au响声文档 .au audio/basic
MIDI歌曲文档 mid,.midi audio/midi,audio/x-midi
RealAudio歌曲文档 .ra, .ram audio/x-pn-realaudio
MPEG文档 .mpg,.mpeg video/mpeg
AVI文档 .avi video/x-msvideo
GZIP文档 .gz application/x-gzip
TAR文档 .tar application/x-tar

Internet中有1个专业机构IANA来确定规范的MIME种类,但Internet发展趋势的太快,许多运用程序流程等不如IANA来确定她们应用的MIME种类为规范种类。因而她们应用在种别中以x-开始的方式标志这个种别都还没变成规范,比如:x-gzip,x-tar等。客观事实上这些种类应用的很普遍,早已变成了客观事实规范。要是顾客机和服务器相互认可这个MIME种类,即便它是不规范的种类也沒有关联,顾客程序流程就可以依据MIME种类,选用实际的解决方式来解决数据信息。而Web服务器和访问器(包含实际操作系统软件)中,缺省都设定了规范的和普遍的MIME种类,仅有针对不普遍的 MIME种类,才必须另外设定服务器和顾客访问器,以开展鉴别。

因为MIME种类与文本文档的后缀有关,因而服务器应用文本文档的后缀来区别不一样文档的MIME种类,服务器中务必界定文本文档后缀和MIME种类之间的对应关联。而顾客程序流程从服务器上接受数据信息的情况下,它只是从服务器接纳数据信息流,其实不掌握文本文档的姓名,因而服务器务必应用额外信息内容来告知顾客程序流程数据信息的MIME种类。服务器在推送真实的数据信息以前,就要先推送标示数据信息的MIME种类的信息内容,这个信息内容应用Content-type重要字开展界定,比如针对HTML文本文档,服务器将最先推送下列两行MIME标志信息内容,这个标志其实不是真实的数据信息文档的1一部分。

Content-type: text/html

留意,第2个人行为1个空行,这是务必的,应用这个空行的目地是将MIME信息内容与真实的数据信息內容隔开开。

MIME (Multipurpose Internet Mail Extensions) 是叙述信息內容种类的因特网规范。
MIME 信息能包括文字、图象、声频、视頻和别的运用程序流程专用的数据信息。
官方的 MIME 信息内容是由 Internet Engineering Task Force (IETF) 在下面的文本文档中出示的:
RFC⑻22 Standard for ARPA Internet text messages

RFC⑵045 MIME Part 1: Format of Internet Message Bodies

RFC⑵046 MIME Part 2: Media Types

RFC⑵047 MIME Part 3: Header Extensions for Non-ASCII Text

RFC⑵048 MIME Part 4: Registration Procedures

RFC⑵049 MIME Part 5: Conformance Criteria and Examples

不一样的运用程序流程适用不一样的 MIME 种类。

MIME Types
MIME 种类


MIME (Multipurpose Internet Mail Extensions) is an Internet standard for describes message content types.
MIME ( 多主要用途的网际电子邮件扩充协议书)是用于叙述信息内容內容种类的国际性规范。

MIME messages can contain text, images, audio, video, and other application-specific data.
MIME 信息内容能够包括文字、图象、声频、视頻和别的的运用程序流程细节数据信息。

Official MIME info is provided by the Internet Engineering Task Force (IETF) in the following documents:
官方的MIME信息内容是由internet工程项目每日任务组(IETF)中的以下文本文档所出示的:

RFC⑻22 Standard for ARPA Internet text messages [ARPA互连网文字信息内容规范]
RFC⑵045 MIME Part 1: Format of Internet Message Bodies [MIME 第1一部分:互联网技术信息内容行为主体的文件格式]
RFC⑵046 MIME Part 2: Media Types [MIME 第2一部分:多新闻媒体种类]
RFC⑵047 MIME Part 3: Header Extensions for Non-ASCII Text [MIME 第3一部分:非ASCII文字的页眉拓展名]
RFC⑵048 MIME Part 4: Registration Procedures [MIME 第4一部分:申请注册程序流程]
RFC⑵049 MIME Part 5: Conformance Criteria and Examples [MIME 第5一部分:1致性规范和实例]
Different applications support different MIME types.
不一样的运用程序流程适用不一样的MIME种类。

The reference below is a list of MIME types supported by Microsoft Internet Information Server version 5.
微软IIS5以上版本号适用下面有关MIME种类的主要参数目录。

MIME Types By Content Type
Content [內容] 种类 中的 MIME 种类

Type/sub-type
种类/2级种类 Extension
拓展名 application/envoy evy application/fractals fif application/futuresplash spl application/hta hta application/internet-property-stream acx application/mac-binhex40 hqx application/msword doc application/msword dot application/octet-stream * application/octet-stream bin application/octet-stream class application/octet-stream dms application/octet-stream exe application/octet-stream lha application/octet-stream lzh application/oda oda application/olescript axs application/pdf pdf application/pics-rules prf application/pkcs10 p10 application/pkix-crl crl application/postscript ai application/postscript eps application/postscript ps application/rtf rtf application/set-payment-initiation setpay application/set-registration-initiation setreg application/vnd.ms-excel xla application/vnd.ms-excel xlc application/vnd.ms-excel xlm application/vnd.ms-excel xls application/vnd.ms-excel xlt application/vnd.ms-excel xlw application/vnd.ms-pkicertstore sst application/vnd.ms-pkiseccat cat application/vnd.ms-pkistl stl application/vnd.ms-powerpoint pot, application/vnd.ms-powerpoint pps application/vnd.ms-powerpoint ppt application/vnd.ms-project mpp application/vnd.ms-works wcm application/vnd.ms-works wdb application/vnd.ms-works wks application/vnd.ms-works wps application/winhlp hlp application/x-bcpio bcpio application/x-cdf cdf application/x-compress z application/x-compressed tgz application/x-cpio cpio application/x-csh csh application/x-director dcr application/x-director dir application/x-director dxr application/x-dvi dvi application/x-gtar gtar application/x-gzip gz application/x-hdf hdf application/x-internet-signup ins application/x-internet-signup isp application/x-iphone iii application/x-javascript js application/x-latex latex application/x-msaccess mdb application/x-mscardfile crd application/x-msclip clp application/x-msdownload dll application/x-msmediaview m13 application/x-msmediaview m14 application/x-msmediaview mvb application/x-msmetafile wmf application/x-msmoney mny application/x-mspublisher pub application/x-msschedule scd application/x-msterminal trm application/x-mswrite wri application/x-netcdf cdf application/x-netcdf nc application/x-perfmon pma application/x-perfmon pmc application/x-perfmon pml application/x-perfmon pmr application/x-perfmon pmw application/x-pkcs12 p12 application/x-pkcs12 pfx application/x-pkcs7-certificates p7b application/x-pkcs7-certificates spc application/x-pkcs7-certreqresp p7r application/x-pkcs7-mime p7c application/x-pkcs7-mime p7m application/x-pkcs7-signature p7s application/x-sh sh application/x-shar shar application/x-stuffit sit application/x-sv4cpio sv4cpio application/x-sv4crc sv4crc application/x-tar tar application/x-tcl tcl application/x-tex tex application/x-texinfo texi application/x-texinfo texinfo application/x-troff roff application/x-troff t application/x-troff tr application/x-troff-man man application/x-troff-me me application/x-troff-ms ms application/x-ustar ustar application/x-wais-source src application/x-x509-ca-cert cer application/x-x509-ca-cert crt application/x-x509-ca-cert der application/ynd.ms-pkipko pko application/zip zip audio/basic au audio/basic snd audio/mid mid audio/mid rmi audio/mpeg mp3 audio/x-aiff aif audio/x-aiff aifc audio/x-aiff aiff audio/x-mpegurl m3u audio/x-pn-realaudio ra audio/x-pn-realaudio ram audio/x-wav wav image/bmp bmp image/cis-cod cod image/gif gif image/ief ief image/jpeg jpe image/jpeg jpeg image/jpeg jpg image/pipeg jfif image/svg+xml svg image/tiff tif image/tiff tiff image/x-cmu-raster ras image/x-cmx cmx image/x-icon ico image/x-portable-anymap pnm image/x-portable-bitmap pbm image/x-portable-graymap pgm image/x-portable-pixmap ppm image/x-rgb rgb image/x-xbitmap xbm image/x-xpixmap xpm image/x-xwindowdump xwd message/rfc822 mht message/rfc822 mhtml message/rfc822 nws text/css css text/h323 323 text/html htm text/html html text/html stm text/iuls uls text/plain bas text/plain c text/plain h text/plain txt text/richtext rtx text/scriptlet sct text/tab-separated-values tsv text/webviewhtml htt text/x-component htc text/x-setext etx text/x-vcard vcf video/mpeg mp2 video/mpeg mpa video/mpeg mpe video/mpeg mpeg video/mpeg mpg video/mpeg mpv2 video/quicktime mov video/quicktime qt video/x-la-asf lsf video/x-la-asf lsx video/x-ms-asf asf video/x-ms-asf asr video/x-ms-asf asx video/x-msvideo avi video/x-sgi-movie movie x-world/x-vrml flr x-world/x-vrml vrml x-world/x-vrml wrl x-world/x-vrml wrz x-world/x-vrml xaf x-world/x-vrml xof


依照文档拓展名列举的Mime种类

Extension
拓展名 Type/sub-type
种类/2级种类   application/octet-stream 323 text/h323 acx application/internet-property-stream ai application/postscript aif audio/x-aiff aifc audio/x-aiff aiff audio/x-aiff asf video/x-ms-asf asr video/x-ms-asf asx video/x-ms-asf au audio/basic avi video/x-msvideo axs application/olescript bas text/plain bcpio application/x-bcpio bin application/octet-stream bmp image/bmp c text/plain cat application/vnd.ms-pkiseccat cdf application/x-cdf cer application/x-x509-ca-cert class application/octet-stream clp application/x-msclip cmx image/x-cmx cod image/cis-cod cpio application/x-cpio crd application/x-mscardfile crl application/pkix-crl crt application/x-x509-ca-cert csh application/x-csh css text/css dcr application/x-director der application/x-x509-ca-cert dir application/x-director dll application/x-msdownload dms application/octet-stream doc application/msword dot application/msword dvi application/x-dvi dxr application/x-director eps application/postscript etx text/x-setext evy application/envoy exe application/octet-stream fif application/fractals flr x-world/x-vrml gif image/gif gtar application/x-gtar gz application/x-gzip h text/plain hdf application/x-hdf hlp application/winhlp hqx application/mac-binhex40 hta application/hta htc text/x-component htm text/html html text/html htt text/webviewhtml ico image/x-icon ief image/ief iii application/x-iphone ins application/x-internet-signup isp application/x-internet-signup jfif image/pipeg jpe image/jpeg jpeg image/jpeg jpg image/jpeg js application/x-javascript latex application/x-latex lha application/octet-stream lsf video/x-la-asf lsx video/x-la-asf lzh application/octet-stream m13 application/x-msmediaview m14 application/x-msmediaview m3u audio/x-mpegurl man application/x-troff-man mdb application/x-msaccess me application/x-troff-me mht message/rfc822 mhtml message/rfc822 mid audio/mid mny application/x-msmoney mov video/quicktime movie video/x-sgi-movie mp2 video/mpeg mp3 audio/mpeg mpa video/mpeg mpe video/mpeg mpeg video/mpeg mpg video/mpeg mpp application/vnd.ms-project mpv2 video/mpeg ms application/x-troff-ms mvb application/x-msmediaview nws message/rfc822 oda application/oda p10 application/pkcs10 p12 application/x-pkcs12 p7b application/x-pkcs7-certificates p7c application/x-pkcs7-mime p7m application/x-pkcs7-mime p7r application/x-pkcs7-certreqresp p7s application/x-pkcs7-signature pbm image/x-portable-bitmap pdf application/pdf pfx application/x-pkcs12 pgm image/x-portable-graymap pko application/ynd.ms-pkipko pma application/x-perfmon pmc application/x-perfmon pml application/x-perfmon pmr application/x-perfmon pmw application/x-perfmon pnm image/x-portable-anymap pot, application/vnd.ms-powerpoint ppm image/x-portable-pixmap pps application/vnd.ms-powerpoint ppt application/vnd.ms-powerpoint prf application/pics-rules ps application/postscript pub application/x-mspublisher qt video/quicktime ra audio/x-pn-realaudio ram audio/x-pn-realaudio ras image/x-cmu-raster rgb image/x-rgb rmi audio/mid roff application/x-troff rtf application/rtf rtx text/richtext scd application/x-msschedule sct text/scriptlet setpay application/set-payment-initiation setreg application/set-registration-initiation sh application/x-sh shar application/x-shar sit application/x-stuffit snd audio/basic spc application/x-pkcs7-certificates spl application/futuresplash src application/x-wais-source sst application/vnd.ms-pkicertstore stl application/vnd.ms-pkistl stm text/html svg image/svg+xml sv4cpio application/x-sv4cpio sv4crc application/x-sv4crc t application/x-troff tar application/x-tar tcl application/x-tcl tex application/x-tex texi application/x-texinfo texinfo application/x-texinfo tgz application/x-compressed tif image/tiff tiff image/tiff tr application/x-troff trm application/x-msterminal tsv text/tab-separated-values txt text/plain uls text/iuls ustar application/x-ustar vcf text/x-vcard vrml x-world/x-vrml wav audio/x-wav wcm application/vnd.ms-works wdb application/vnd.ms-works wks application/vnd.ms-works wmf application/x-msmetafile wps application/vnd.ms-works wri application/x-mswrite wrl x-world/x-vrml wrz x-world/x-vrml xaf x-world/x-vrml xbm image/x-xbitmap xla application/vnd.ms-excel xlc application/vnd.ms-excel xlm application/vnd.ms-excel xls application/vnd.ms-excel xlt application/vnd.ms-excel xlw application/vnd.ms-excel xof x-world/x-vrml xpm image/x-xpixmap xwd image/x-xwindowdump z application/x-compress zip application/zip