`

http MIME-Typen

 
阅读更多

需要处理文件上传下载,其中涉及不同的文件类型,故找了些资料来学习下,

 

首先给出http中 常见的MIME-TYPE 转自:http://de.selfhtml.org/diverses/mimetypen.htm

 

 

 

MIME-Typ Dateiendung(en) Bedeutung
application/acad *.dwg AutoCAD-Dateien (nach NCSA)
application/applefile   AppleFile-Dateien
application/astound *.asd *.asn Astound-Dateien
application/dsptype *.tsp TSP-Dateien
application/dxf *.dxf AutoCAD-Dateien (nach CERN)
application/futuresplash *.spl Flash Futuresplash-Dateien
application/gzip *.gz GNU Zip-Dateien
application/listenup *.ptlk Listenup-Dateien
application/mac-binhex40 *.hqx Macintosh Binärdateien
application/mbedlet *.mbd Mbedlet-Dateien
application/mif *.mif FrameMaker Interchange Format Dateien
application/msexcel *.xls *.xla Microsoft Excel Dateien
application/mshelp *.hlp *.chm Microsoft Windows Hilfe Dateien
application/mspowerpoint *.ppt *.ppz *.pps *.pot Microsoft Powerpoint Dateien
application/msword *.doc *.dot Microsoft Word Dateien
application/octet-stream *.bin *.exe *.com *.dll *.class Ausführbare Dateien
application/oda *.oda Oda-Dateien
application/pdf *.pdf Adobe PDF-Dateien
application/postscript *.ai *.eps *.ps Adobe PostScript-Dateien
application/rtc *.rtc RTC-Dateien
application/rtf *.rtf Microsoft RTF-Dateien
application/studiom *.smp Studiom-Dateien
application/toolbook *.tbk Toolbook-Dateien
application/vocaltec-media-desc *.vmd Vocaltec Mediadesc-Dateien
application/vocaltec-media-file *.vmf Vocaltec Media-Dateien
application/xhtml+xml *.htm *.html *.shtml *.xhtml XHTML-Dateien
application/xml *.xml XML-Dateien
application/x-bcpio *.bcpio BCPIO-Dateien
application/x-compress *.z zlib-komprimierte Dateien
application/x-cpio *.cpio CPIO-Dateien
application/x-csh *.csh C-Shellscript-Dateien
application/x-director *.dcr *.dir *.dxr Macromedia Director-Dateien
application/x-dvi *.dvi DVI-Dateien
application/x-envoy *.evy Envoy-Dateien
application/x-gtar *.gtar GNU tar-Archivdateien
application/x-hdf *.hdf HDF-Dateien
application/x-httpd-php *.php *.phtml PHP-Dateien
application/x-javascript *.js serverseitige JavaScript-Dateien
application/x-latex *.latex LaTeX-Quelldateien
application/x-macbinary *.bin Macintosh Binärdateien
application/x-mif *.mif FrameMaker Interchange Format Dateien
application/x-netcdf *.nc *.cdf Unidata CDF-Dateien
application/x-nschat *.nsc NS Chat-Dateien
application/x-sh *.sh Bourne Shellscript-Dateien
application/x-shar *.shar Shell-Archivdateien
application/x-shockwave-flash *.swf *.cab Flash Shockwave-Dateien
application/x-sprite *.spr *.sprite Sprite-Dateien
application/x-stuffit *.sit Stuffit-Dateien
application/x-supercard *.sca Supercard-Dateien
application/x-sv4cpio *.sv4cpio CPIO-Dateien
application/x-sv4crc *.sv4crc CPIO-Dateien mit CRC
application/x-tar *.tar tar-Archivdateien
application/x-tcl *.tcl TCL Scriptdateien
application/x-tex *.tex TeX-Dateien
application/x-texinfo *.texinfo *.texi Texinfo-Dateien
application/x-troff *.t *.tr *.roff TROFF-Dateien (Unix)
application/x-troff-man *.man *.troff TROFF-Dateien mit MAN-Makros (Unix)
application/x-troff-me *.me *.troff TROFF-Dateien mit ME-Makros (Unix)
application/x-troff-ms *.me *.troff TROFF-Dateien mit MS-Makros (Unix)
application/x-ustar *.ustar tar-Archivdateien (Posix)
application/x-wais-source *.src WAIS Quelldateien
application/x-www-form-urlencoded   HTML-Formulardaten an CGI
application/zip *.zip ZIP-Archivdateien
audio/basic *.au *.snd Sound-Dateien
audio/echospeech *.es Echospeed-Dateien
audio/tsplayer *.tsi TS-Player-Dateien
audio/voxware *.vox Vox-Dateien
audio/x-aiff *.aif *.aiff *.aifc AIFF-Sound-Dateien
audio/x-dspeeh *.dus *.cht Sprachdateien
audio/x-midi *.mid *.midi MIDI-Dateien
audio/x-mpeg *.mp2 MPEG-Dateien
audio/x-pn-realaudio *.ram *.ra RealAudio-Dateien
audio/x-pn-realaudio-plugin *.rpm RealAudio-Plugin-Dateien
audio/x-qt-stream *.stream Quicktime-Streaming-Dateien
audio/x-wav *.wav WAV-Dateien
drawing/x-dwf *.dwf Drawing-Dateien
image/cis-cod *.cod CIS-Cod-Dateien
image/cmu-raster *.ras CMU-Raster-Dateien
image/fif *.fif FIF-Dateien
image/gif *.gif GIF-Dateien
image/ief *.ief IEF-Dateien
image/jpeg *.jpeg *.jpg *.jpe JPEG-Dateien
image/png *.png PNG-Dateien
image/tiff *.tiff *.tif TIFF-Dateien
image/vasa *.mcf Vasa-Dateien
image/vnd.wap.wbmp *.wbmp Bitmap-Dateien (WAP)
image/x-freehand *.fh4 *.fh5 *.fhc Freehand-Dateien
image/x-icon *.ico Icon-Dateien (z.B. Favoriten-Icons)
image/x-portable-anymap *.pnm PBM Anymap Dateien
image/x-portable-bitmap *.pbm PBM Bitmap Dateien
image/x-portable-graymap *.pgm PBM Graymap Dateien
image/x-portable-pixmap *.ppm PBM Pixmap Dateien
image/x-rgb *.rgb RGB-Dateien
image/x-windowdump *.xwd X-Windows Dump
image/x-xbitmap *.xbm XBM-Dateien
image/x-xpixmap *.xpm XPM-Dateien
message/external-body   Nachricht mit externem Inhalt
message/http   HTTP-Headernachricht
message/news   Newsgroup-Nachricht
message/partial   Nachricht mit Teilinhalt
message/rfc822   Nachricht nach RFC 2822
model/vrml *.wrl Visualisierung virtueller Welten (VRML)
multipart/alternative   mehrteilige Daten gemischt
multipart/byteranges   mehrteilige Daten mit Byte-Angaben
multipart/digest   mehrteilige Daten / Auswahl
multipart/encrypted   mehrteilige Daten verschlüsselt
multipart/form-data   mehrteilige Daten aus HTML-Formular (z.B. File-Upload)
multipart/mixed   mehrteilige Daten gemischt
multipart/parallel   mehrteilige Daten parallel
multipart/related   mehrteilige Daten / verbunden
multipart/report   mehrteilige Daten / Bericht
multipart/signed   mehrteilige Daten / bezeichnet
multipart/voice-message   mehrteilige Daten / Sprachnachricht
text/comma-separated-values *.csv kommaseparierte Datendateien
text/css *.css CSS Stylesheet-Dateien
text/html *.htm *.html *.shtml HTML-Dateien
text/javascript *.js JavaScript-Dateien
text/plain *.txt reine Textdateien
text/richtext *.rtx Richtext-Dateien
text/rtf *.rtf Microsoft RTF-Dateien
text/tab-separated-values *.tsv tabulator-separierte Datendateien
text/vnd.wap.wml *.wml WML-Dateien (WAP)
application/vnd.wap.wmlc *.wmlc WMLC-Dateien (WAP)
text/vnd.wap.wmlscript *.wmls WML-Scriptdateien (WAP)
application/vnd.wap.wmlscriptc *.wmlsc WML-Script-C-dateien (WAP)
text/xml *.xml XML-Dateien
text/xml-external-parsed-entity   extern geparste XML-Dateien
text/x-setext *.etx SeText-Dateien
text/x-sgml *.sgm *.sgml SGML-Dateien
text/x-speech *.talk *.spc Speech-Dateien
video/mpeg *.mpeg *.mpg *.mpe MPEG-Dateien
video/quicktime *.qt *.mov Quicktime-Dateien
video/vnd.vivo *.viv *.vivo Vivo-Dateien
video/x-msvideo *.avi Microsoft AVI-Dateien
video/x-sgi-movie *.movie Movie-Dateien
workbook/formulaone *.vts *.vtts FormulaOne-Dateien
x-world/x-3dmf *.3dmf *.3dm *.qd3d *.qd3 3DMF-Dateien
x-world/x-vrml *.wrl Visualisierung virtueller Welten (VRML) (veralteter MIME-Typ, aktuell ist model/vrml)

 

 

 

 

其次是iana 官方的MIME 分类 http://www.iana.org/assignments/media-types/index.html

MIME Media Types

 

The following is the list of Directories of Content Types and Subtypes:

application

audio

example

image

message

model

multipart

text

video

 

 

 

 

最后是一份类型反查表,这里只给出链接

http://www.webmaster-toolkit.com/mime-types.shtml

 

 

对于MIME TYPE一般还会有扩展处理参数配合使用,例如 Content-Disposition

 

针对Content-Disposition的文档主要有 http://www.ietf.org/rfc/rfc1806.txt

摘录出BNF 

 

 

 In the extended BNF notation of [RFC 822], the Content-Disposition
   header field is defined as follows:

        disposition := "Content-Disposition" ":"
                       disposition-type
                       *(";" disposition-parm)

        disposition-type := "inline"
                          / "attachment"
                          / extension-token
                          ; values are not case-sensitive

        disposition-parm := filename-parm / parameter

        filename-parm := "filename" "=" value;

 

 

最后附上http1.1 rfc文档

 

http://www.ietf.org/rfc/rfc2616.txt

分享到:
评论

相关推荐

    css样式无法加载Refused to apply style from ‘http://localhost:8080/static/css/style.css’ because its MIME

    Refused to apply style from ‘http://localhost:8080/static/css/style.css’ because its MIME type (‘application/json’) is not a supported stylesheet MIME type, and strict MIME checking is enabled. ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    + [enterprise] added property "MimeType" for each output format in server configuration + [enterprise] added property "BrowserPrint" in server configuration - allow printing by browser, added new ...

    Nginx RPM 包定制制作

    fpm -s dir -t rpm -n nginx -v 1.6.3 -d 'pcre-devel,openssl-devel' --post-install /server/scripts/nginx_rpm.sh -f /application/nginx-1.6.3/ 检查 rpm -qpl nginx-1.6.3-1.x86_64.rpm [root@nginx tools]...

    php.ini-development

    http://php.net/configuration.file ; The syntax of the file is extremely simple. Whitespace and lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e...

    Sakemail

    Kessler web: http://groups.yahoo.com/group/sakemail/To subscribe to the mailing list of sakemail, just go tohttp://groups.yahoo.com/group/sakemail/History:0.9 - First released version0.9.1b -Fixed ...

    杏林同学录(五)

    密码查询:class/querypsw.php <... <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <TITLE>.../TITLE>... charset=gb2312n"; // Mime type $subje

    linux.chm文档

    file file1 outputs the mime type of the file as text iconv -l 列出已知的编码 iconv -f fromEncoding -t toEncoding inputFile > outputFile creates a new from the given input file by assuming it is ...

    netcat 瑞士军刀 linux windows netcat 瑞士军刀 linux windows

     -n 指定数字的IP地址,不能用hostname  -o file 记录16进制的传输  -p port 本地端口号  -r 任意指定本地及远程端口  -s addr 本地源地址  -u UDP模式  -v 详细输出——用两个-v可得到更详细的内容 ...

    php手册.chm,php手册

    Mimetype Functions LXXVII. Ming functions for Flash LXXVIII. Miscellaneous Functions LXXIX. mnoGoSearch Functions LXXX. Mohawk Software Session Handler Functions LXXXI. mSQL Functions LXXXII. ...

    php帮助文档,php。chm,php必备的中文手册

    Mimetype Functions LXXVIII. Ming functions for Flash LXXIX. Miscellaneous Functions LXXX. mnoGoSearch Functions LXXXI. Microsoft SQL Server Functions LXXXII. Microsoft SQL Server and Sybase Functions...

    计算机网络第六版答案

    Computer Networking: A Top-Down Approach, 6th Edition Solutions to Review Questions and Problems Version Date: May 2012 ...This document contains the solutions to review questions and problems for...

    Java邮件开发Fundamentals of the JavaMail API

    doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools today. After downloading the framework, unbundle the jaf1_0_1.zip file, and add the activation....

    jquery-1.1.3 效率提高800%

    nth-child(n)")Space-separated attributes: After being removed in jQuery 1.0, this selector has now been brought back by popular demand. It allows you to locate individual items in a space-separated ...

    android手机通讯录备份还原代码

    values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE); values.put(StructuredName.GIVEN_NAME, name); getContentResolver().insert(Data.CONTENT_URI, values); values.clear(); values.put(Data....

    手机销售系统 是 是少数生生世世

    $this.Icon" type="System.Drawing.Icon, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64"> ...

    Beginning Python (2005).pdf

    DTDs Aren’t Exactly XML 280 Limitations of DTDs 280 Schemas 280 An Example Schema 280 Schemas Are Pure XML 281 Schemas Are Hierarchical 281 Other Advantages of Schemas 281 Schemas Are Less ...

    PHP手册(带评论版-2008-03-14).part2.rar

    Mimetype Functions LXXVII. Ming functions for Flash LXXVIII. Miscellaneous Functions LXXIX. mnoGoSearch Functions LXXX. Mohawk Software Session Handler Functions LXXXI. mSQL Functions LXXXII. ...

    PHP手册(带评论版-2008-03-14).part1.rar

    Mimetype Functions LXXVII. Ming functions for Flash LXXVIII. Miscellaneous Functions LXXIX. mnoGoSearch Functions LXXX. Mohawk Software Session Handler Functions LXXXI. mSQL Functions LXXXII. ...

    Python Cookbook, 2nd Edition

    Enriching the Dictionary Type with Ratings Functionality Recipe 5.15. Sorting Names and Separating Them by Initials Chapter 6. Object-Oriented Programming Introduction Recipe 6.1. Converting ...

    ZendFramework中文文档

    Retrieve profiles by query type 10.4. Zend_Db_Select 10.4.1. 简介 10.4.2. 同一表中查询多列数据 10.4.3. 多表联合查询 10.4.4. WHERE条件 10.4.5. GROUP BY分句 10.4.6. HAVING 条件 10.4.7. ORDER BY...

Global site tag (gtag.js) - Google Analytics