mime类型_mime类型大全 - CSDN
精华内容
参与话题
  • 常见的MIME类型

    万次阅读 2018-01-15 21:13:42
    常见的MIME类型  超文本标记语言文本 .html,.html text/html   普通文本 .txt text/plain   RTF文本 .rtf application/rtf   GIF图形 .gif image/gif   JPEG图形 .jpeg,.jpg image/jpeg   au声音...

    常见的MIME类型
      超文本标记语言文本 .html,.html text/html 
      普通文本 .txt text/plain 
      RTF文本 .rtf application/rtf 
      GIF图形 .gif image/gif 
      JPEG图形 .jpeg,.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


    参考:http://baike.baidu.com/view/160611.htm


    格式前面为后辍名,后面为对应的MIME型(例如:rar application/x-rar-compressed 表示.RAR对应的是application/x-rar-compressed )
      application/vnd.lotus-1-2-3
      3gp video/3gpp
      aab application/x-authoware-bin
      aam application/x-authoware-map
      aas application/x-authoware-seg
      ai application/postscript
      aif audio/x-aiff
      aifc audio/x-aiff
      aiff audio/x-aiff
      als audio/X-Alpha5
      amc application/x-mpeg
      ani application/octet-stream
      asc text/plain
      asd application/astound
      asf video/x-ms-asf
      asn application/astound
      asp application/x-asap
      asx video/x-ms-asf
      au audio/basic
      avb application/octet-stream
      avi video/x-msvideo
      awb audio/amr-wb
      bcpio application/x-bcpio
      bin application/octet-stream
      bld application/bld
      bld2 application/bld2
      bmp application/x-MS-bmp
      bpk application/octet-stream
      bz2 application/x-bzip2
      cal image/x-cals
      ccn application/x-cnc
      cco application/x-cocoa
      cdf application/x-netcdf
      cgi magnus-internal/cgi
      chat application/x-chat
      class application/octet-stream
      clp application/x-msclip
      cmx application/x-cmx
      co application/x-cult3d-object
      cod image/cis-cod
      cpio application/x-cpio
      cpt application/mac-compactpro
      crd application/x-mscardfile
      csh application/x-csh
      csm chemical/x-csml
      csml chemical/x-csml
      css text/css
      cur application/octet-stream
      dcm x-lml/x-evm
      dcr application/x-director
      dcx image/x-dcx
      dhtml text/html
      dir application/x-director
      dll application/octet-stream
      dmg application/octet-stream
      dms application/octet-stream
      doc application/msword
      dot application/x-dot
      dvi application/x-dvi
      dwf drawing/x-dwf
      dwg application/x-autocad
      dxf application/x-autocad
      dxr application/x-director
      ebk application/x-expandedbook
      emb chemical/x-embl-dl-nucleotide
      embl chemical/x-embl-dl-nucleotide
      eps application/postscript
      eri image/x-eri
      es audio/echospeech
      esl audio/echospeech
      etc application/x-earthtime
      etx text/x-setext
      evm x-lml/x-evm
      evy application/x-envoy
      exe application/octet-stream
      fh4 image/x-freehand
      fh5 image/x-freehand
      fhc image/x-freehand
      fif image/fif
      fm application/x-maker
      fpx image/x-fpx
      fvi video/isivideo
      gau chemical/x-gaussian-input
      gca application/x-gca-compressed
      gdb x-lml/x-gdb
      gif image/gif
      gps application/x-gps
      gtar application/x-gtar
      gz application/x-gzip
      hdf application/x-hdf
      hdm text/x-hdml
      hdml text/x-hdml
      hlp application/winhlp
      hqx application/mac-binhex40
      htm text/html
      html text/html
      hts text/html
      ice x-conference/x-cooltalk
      ico application/octet-stream
      ief image/ief
      ifm image/gif
      ifs image/ifs
      imy audio/melody
      ins application/x-NET-Install
      ips application/x-ipscript
      ipx application/x-ipix
      it audio/x-mod
      itz audio/x-mod
      ivr i-world/i-vrml
      j2k image/j2k
      jad text/vnd.sun.j2me.app-descriptor
      jam application/x-jam
      jar application/java-archive
      jnlp application/x-java-jnlp-file
      jpe image/jpeg
      jpeg image/jpeg
      jpg image/jpeg
      jpz image/jpeg
      js application/x-javascript
      jwc application/jwc
      kjx application/x-kjx
      lak x-lml/x-lak
      latex application/x-latex
      lcc application/fastman
      lcl application/x-digitalloca
      lcr application/x-digitalloca
      lgh application/lgh
      lha application/octet-stream
      lml x-lml/x-lml
      lmlpack x-lml/x-lmlpack
      lsf video/x-ms-asf
      lsx video/x-ms-asf
      lzh application/x-lzh
      m13 application/x-msmediaview
      m14 application/x-msmediaview
      m15 audio/x-mod
      m3u audio/x-mpegurl
      m3url audio/x-mpegurl
      ma1 audio/ma1
      ma2 audio/ma2
      ma3 audio/ma3
      ma5 audio/ma5
      man application/x-troff-man
      map magnus-internal/imagemap
      mbd application/mbedlet
      mct application/x-mascot
      mdb application/x-msaccess
      mdz audio/x-mod
      me application/x-troff-me
      mel text/x-vmel
      mi application/x-mif
      mid audio/midi
      midi audio/midi
      mif application/x-mif
      mil image/x-cals
      mio audio/x-mio
      mmf application/x-skt-lbs
      mng video/x-mng
      mny application/x-msmoney
      moc application/x-mocha
      mocha application/x-mocha
      mod audio/x-mod
      mof application/x-yumekara
      mol chemical/x-mdl-molfile
      mop chemical/x-mopac-input
      mov video/quicktime
      movie video/x-sgi-movie
      mp2 audio/x-mpeg
      mp3 audio/x-mpeg
      mp4 video/mp4
      mpc application/vnd.mpohun.certificate
      mpe video/mpeg
      mpeg video/mpeg
      mpg video/mpeg
      mpg4 video/mp4
      mpga audio/mpeg
      mpn application/vnd.mophun.application
      mpp application/vnd.ms-project
      mps application/x-mapserver
      mrl text/x-mrml
      mrm application/x-mrm
      ms application/x-troff-ms
      mts application/metastream
      mtx application/metastream
      mtz application/metastream
      mzv application/metastream
      nar application/zip
      nbmp image/nbmp
      nc application/x-netcdf
      ndb x-lml/x-ndb
      ndwn application/ndwn
      nif application/x-nif
      nmz application/x-scream
      nokia-op-logo image/vnd.nok-oplogo-color
      npx application/x-netfpx
      nsnd audio/nsnd
      nva application/x-neva1
      oda application/oda
      oom application/x-AtlasMate-Plugin
      pac audio/x-pac
      pae audio/x-epac
      pan application/x-pan
      pbm image/x-portable-bitmap
      pcx image/x-pcx
      pda image/x-pda
      pdb chemical/x-pdb
      pdf application/pdf
      pfr application/font-tdpfr
      pgm image/x-portable-graymap
      pict image/x-pict
      pm application/x-perl
      pmd application/x-pmd
      png image/png
      pnm image/x-portable-anymap
      pnz image/png
      pot application/vnd.ms-powerpoint
      ppm image/x-portable-pixmap
      pps application/vnd.ms-powerpoint
      ppt application/vnd.ms-powerpoint
      pqf application/x-cprplayer
      pqi application/cprplayer
      prc application/x-prc
      proxy application/x-ns-proxy-autoconfig
      ps application/postscript
      ptlk application/listenup
      pub application/x-mspublisher
      pvx video/x-pv-pvx
      qcp audio/vnd.qcelp
      qt video/quicktime
      qti image/x-quicktime
      qtif image/x-quicktime
      r3t text/vnd.rn-realtext3d
      ra audio/x-pn-realaudio
      ram audio/x-pn-realaudio
      rar application/x-rar-compressed
      ras image/x-cmu-raster
      rdf application/rdf+xml
      rf image/vnd.rn-realflash
      rgb image/x-rgb
      rlf application/x-richlink
      rm audio/x-pn-realaudio
      rmf audio/x-rmf
      rmm audio/x-pn-realaudio
      rmvb audio/x-pn-realaudio
      rnx application/vnd.rn-realplayer
      roff application/x-troff
      rp image/vnd.rn-realpix
      rpm audio/x-pn-realaudio-plugin
      rt text/vnd.rn-realtext
      rte x-lml/x-gps
      rtf application/rtf
      rtg application/metastream
      rtx text/richtext
      rv video/vnd.rn-realvideo
      rwc application/x-rogerwilco
      s3m audio/x-mod
      s3z audio/x-mod
      sca application/x-supercard
      scd application/x-msschedule
      sdf application/e-score
      sea application/x-stuffit
      sgm text/x-sgml
      sgml text/x-sgml
      sh application/x-sh
      shar application/x-shar
      shtml magnus-internal/parsed-html
      shw application/presentations
      si6 image/si6
      si7 image/vnd.stiwap.sis
      si9 image/vnd.lgtwap.sis
      sis application/vnd.symbian.install
      sit application/x-stuffit
      skd application/x-Koan
      skm application/x-Koan
      skp application/x-Koan
      skt application/x-Koan
      slc application/x-salsa
      smd audio/x-smd
      smi application/smil
      smil application/smil
      smp application/studiom
      smz audio/x-smd
      snd audio/basic
      spc text/x-speech
      spl application/futuresplash
      spr application/x-sprite
      sprite application/x-sprite
      spt application/x-spt
      src application/x-wais-source
      stk application/hyperstudio
      stm audio/x-mod
      sv4cpio application/x-sv4cpio
      sv4crc application/x-sv4crc
      svf image/vnd
      svg image/svg-xml
      svh image/svh
      svr x-world/x-svr
      swf application/x-shockwave-flash
      swfl application/x-shockwave-flash
      t application/x-troff
      tad application/octet-stream
      talk text/x-speech
      tar application/x-tar
      taz application/x-tar
      tbp application/x-timbuktu
      tbt application/x-timbuktu
      tcl application/x-tcl
      tex application/x-tex
      texi application/x-texinfo
      texinfo application/x-texinfo
      tgz application/x-tar
      thm application/vnd.eri.thm
      tif image/tiff
      tiff image/tiff
      tki application/x-tkined
      tkined application/x-tkined
      toc application/toc
      toy image/toy
      tr application/x-troff
      trk x-lml/x-gps
      trm application/x-msterminal
      tsi audio/tsplayer
      tsp application/dsptype
      tsv text/tab-separated-values
      tsv text/tab-separated-values
      ttf application/octet-stream
      ttz application/t-time
      txt text/plain
      ult audio/x-mod
      ustar application/x-ustar
      uu application/x-uuencode
      uue application/x-uuencode
      vcd application/x-cdlink
      vcf text/x-vcard
      vdo video/vdo
      vib audio/vib
      viv video/vivo
      vivo video/vivo
      vmd application/vocaltec-media-desc
      vmf application/vocaltec-media-file
      vmi application/x-dreamcast-vms-info
      vms application/x-dreamcast-vms
      vox audio/voxware
      vqe audio/x-twinvq-plugin
      vqf audio/x-twinvq
      vql audio/x-twinvq
      vre x-world/x-vream
      vrml x-world/x-vrml
      vrt x-world/x-vrt
      vrw x-world/x-vream
      vts workbook/formulaone
      wav audio/x-wav
      wax audio/x-ms-wax
      wbmp image/vnd.wap.wbmp
      web application/vnd.xara
      wi image/wavelet
      wis application/x-InstallShield
      wm video/x-ms-wm
      wma audio/x-ms-wma
      wmd application/x-ms-wmd
      wmf application/x-msmetafile
      wml text/vnd.wap.wml
      wmlc application/vnd.wap.wmlc
      wmls text/vnd.wap.wmlscript
      wmlsc application/vnd.wap.wmlscriptc
      wmlscript text/vnd.wap.wmlscript
      wmv audio/x-ms-wmv
      wmx video/x-ms-wmx
      wmz application/x-ms-wmz
      wpng image/x-up-wpng
      wpt x-lml/x-gps
      wri application/x-mswrite
      wrl x-world/x-vrml
      wrz x-world/x-vrml
      ws text/vnd.wap.wmlscript
      wsc application/vnd.wap.wmlscriptc
      wv video/wavelet
      wvx video/x-ms-wvx
      wxl application/x-wxl
      x-gzip application/x-gzip
      xar application/vnd.xara
      xbm image/x-xbitmap
      xdm application/x-xdma
      xdma application/x-xdma
      xdw application/vnd.fujixerox.docuworks
      xht application/xhtml+xml
      xhtm application/xhtml+xml
      xhtml application/xhtml+xml
      xla application/vnd.ms-excel
      xlc application/vnd.ms-excel
      xll application/x-excel
      xlm application/vnd.ms-excel
      xls application/vnd.ms-excel
      xlt application/vnd.ms-excel
      xlw application/vnd.ms-excel
      xm audio/x-mod
      xml text/xml
      xmz audio/x-mod
      xpi application/x-xpinstall
      xpm image/x-xpixmap
      xsit text/xml
      xsl text/xml
      xul text/xul
      xwd image/x-xwindowdump
      xyz chemical/x-pdb
      yz1 application/x-yz1
      z application/x-compress
      zac application/x-zaurus-zac
      zip application/zip

    展开全文
  • MIME类型是什么

    2018-11-01 11:48:13
    打个比方:你的代码中需要浏览器加载一个视频,视频文件名“cangTeacher.avi ”传进去了,你希望浏览器用视频播放器打开,那么就需要指定这个应用程序,怎么指定呢,就需要用到MIME类型中的video类型。 格式是:...

    当浏览器访问你提供的某种扩展名文件时,指定浏览器用什么应用程序打开这种扩展名文件

    打个比方:你的代码中需要浏览器加载一个视频,视频文件名“cangTeacher.avi ”传进去了,你希望浏览器用视频播放器打开,那么就需要指定这个应用程序,怎么指定呢,就需要用到MIME类型中的video类型。

    格式是:function(“cangTeacher.avi ”,“video”);前面一个参数就是传入的文件,后面一个参数就是用什么应用程序打开这个文件,也就是所谓的MIME

    常见的MIME类型有:

    等等。

    展开全文
  • 常用MIME类型

    2018-10-08 13:22:31
    MIME类型 文档文件类型的 .ai application/postscript .eps application/postscript .exe application/octet-stream .doc application/vnd.ms-word .xls application/vnd.ms-excel .ppt applicatio...
    文件后缀 MIME类型
    文档文件类型的
    .ai application/postscript
    .eps application/postscript
    .exe application/octet-stream
    .doc application/vnd.ms-word
    .xls application/vnd.ms-excel
    .ppt application/vnd.ms-powerpoint
    .pps application/vnd.ms-powerpoint
    .pdf application/pdf
    .xml application/xml
    .odt application/vnd.oasis.opendocument.text
    .swf application/x-shockwave-flash
    压缩文件类型的
    .gz application/x-gzip
    .tgz application/x-gzip
    .bz application/x-bzip2
    .bz2 application/x-bzip2
    .tbz application/x-bzip2
    .zip application/zip
    .rar application/x-rar
    .tar application/x-tar
    .7z application/x-7z-compressed
    文字类型
    .txt text/plain
    .php text/x-php
    .html text/html
    .htm text/html
    .js text/javascript
    .css text/css
    .rtf text/rtf
    .rtfd text/rtfd
    .py text/x-python
    .java text/x-java-source
    .rb text/x-ruby
    .sh text/x-shellscript
    .pl text/x-perl
    .sql text/x-sql
    图片类型的
    .bmp image/x-ms-bmp
    .bmp image/x-ms-bmp
    .jpg image/jpeg
    .jpeg image/jpeg
    .gif image/gif
    .png image/png
    .tif image/tiff
    .tiff image/tiff
    .tga image/x-targa
    .psd image/vnd.adobe.photoshop
    音频文件类型的
    .mp3 audio/mpeg
    .mid audio/midi
    .ogg audio/ogg
    .mp4a audio/mp4
    .wav audio/wav
    .wma audio/x-ms-wma
    m4a audio/mp4a-latm
    视频文件类型的
    .avi video/x-msvideo
    .dv video/x-dv
    .mp4 video/mp4
    .mpeg video/mpeg
    .mpg video/mpeg
    .mov video/quicktime
    .wm video/x-ms-wmv
    .flv video/x-flv
    .mkv video/x-matroska
    展开全文
  • MIME规范—MIME类型大全

    万次阅读 2016-04-07 13:43:24
    我只是将W3C中的两个表格整理成了二维数组的格式: * 按照内容类型排列的 Mime 类型列表 *按照文件扩展名排列的 Mime 类型列表

    提问:同一个后缀名对应多个MIME值是什么情况,怎么解释。希望有明白的能留言交流。


    我只是将W3C中的两个表格整理成了二维数组的格式:

       /**
         * 按照内容类型排列的 Mime 类型列表
         */
        String[][] MimeTableFirst = {
                {"application/envoy","evy"},
                {"application/fractals","fif"},
                {"application/futuresplash","spl"},
                {"application/hta","hta"},
                {"application/internet-property-stream","a"},
                {"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","set"},
                {"application/set-registration-initiation",""},
                {"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-outlook","msg"},
                {"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-shockwave-flash","swf"},
                {"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 类型列表
        */
        String[][] MimeTableSecond = {
                {"*","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"},
                {"swf","application/x-shockwave-flash"},
                {"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"}
        };

    来自小米文件管理器:

    /*
     * Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
     *
     * This file is part of FileExplorer.
     *
     * FileExplorer is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * FileExplorer is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with SwiFTP.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    package net.micode.fileexplorer;
    
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Properties;
    
    /**
     * Utilities for dealing with MIME types.
     * Used to implement java.net.URLConnection and android.webkit.MimeTypeMap.
     */
    public final class MimeUtils {
        private static final Map<String, String> mimeTypeToExtensionMap = new HashMap<String, String>();
    
        private static final Map<String, String> extensionToMimeTypeMap = new HashMap<String, String>();
    
        static {
            // The following table is based on /etc/mime.types data minus
            // chemical/* MIME types and MIME types that don't map to any
            // file extensions. We also exclude top-level domain names to
            // deal with cases like:
            //
            // mail.google.com/a/google.com
            //
            // and "active" MIME types (due to potential security issues).
    
            add("application/andrew-inset", "ez");
            add("application/dsptype", "tsp");
            add("application/futuresplash", "spl");
            add("application/hta", "hta");
            add("application/mac-binhex40", "hqx");
            add("application/mac-compactpro", "cpt");
            add("application/mathematica", "nb");
            add("application/msaccess", "mdb");
            add("application/oda", "oda");
            add("application/ogg", "ogg");
            add("application/pdf", "pdf");
            add("application/pgp-keys", "key");
            add("application/pgp-signature", "pgp");
            add("application/pics-rules", "prf");
            add("application/rar", "rar");
            add("application/rdf+xml", "rdf");
            add("application/rss+xml", "rss");
            add("application/zip", "zip");
            add("application/vnd.android.package-archive", "apk");
            add("application/vnd.cinderella", "cdy");
            add("application/vnd.ms-pki.stl", "stl");
            add("application/vnd.oasis.opendocument.database", "odb");
            add("application/vnd.oasis.opendocument.formula", "odf");
            add("application/vnd.oasis.opendocument.graphics", "odg");
            add("application/vnd.oasis.opendocument.graphics-template", "otg");
            add("application/vnd.oasis.opendocument.image", "odi");
            add("application/vnd.oasis.opendocument.spreadsheet", "ods");
            add("application/vnd.oasis.opendocument.spreadsheet-template", "ots");
            add("application/vnd.oasis.opendocument.text", "odt");
            add("application/vnd.oasis.opendocument.text-master", "odm");
            add("application/vnd.oasis.opendocument.text-template", "ott");
            add("application/vnd.oasis.opendocument.text-web", "oth");
            add("application/vnd.google-earth.kml+xml", "kml");
            add("application/vnd.google-earth.kmz", "kmz");
            add("application/msword", "doc");
            add("application/msword", "dot");
            add("application/vnd.openxmlformats-officedocument.wordprocessingml.document", "docx");
            add("application/vnd.openxmlformats-officedocument.wordprocessingml.template", "dotx");
            add("application/vnd.ms-excel", "xls");
            add("application/vnd.ms-excel", "xlt");
            add("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "xlsx");
            add("application/vnd.openxmlformats-officedocument.spreadsheetml.template", "xltx");
            add("application/vnd.ms-powerpoint", "ppt");
            add("application/vnd.ms-powerpoint", "pot");
            add("application/vnd.ms-powerpoint", "pps");
            add("application/vnd.openxmlformats-officedocument.presentationml.presentation", "pptx");
            add("application/vnd.openxmlformats-officedocument.presentationml.template", "potx");
            add("application/vnd.openxmlformats-officedocument.presentationml.slideshow", "ppsx");
            add("application/vnd.rim.cod", "cod");
            add("application/vnd.smaf", "mmf");
            add("application/vnd.stardivision.calc", "sdc");
            add("application/vnd.stardivision.draw", "sda");
            add("application/vnd.stardivision.impress", "sdd");
            add("application/vnd.stardivision.impress", "sdp");
            add("application/vnd.stardivision.math", "smf");
            add("application/vnd.stardivision.writer", "sdw");
            add("application/vnd.stardivision.writer", "vor");
            add("application/vnd.stardivision.writer-global", "sgl");
            add("application/vnd.sun.xml.calc", "sxc");
            add("application/vnd.sun.xml.calc.template", "stc");
            add("application/vnd.sun.xml.draw", "sxd");
            add("application/vnd.sun.xml.draw.template", "std");
            add("application/vnd.sun.xml.impress", "sxi");
            add("application/vnd.sun.xml.impress.template", "sti");
            add("application/vnd.sun.xml.math", "sxm");
            add("application/vnd.sun.xml.writer", "sxw");
            add("application/vnd.sun.xml.writer.global", "sxg");
            add("application/vnd.sun.xml.writer.template", "stw");
            add("application/vnd.visio", "vsd");
            add("application/x-abiword", "abw");
            add("application/x-apple-diskimage", "dmg");
            add("application/x-bcpio", "bcpio");
            add("application/x-bittorrent", "torrent");
            add("application/x-cdf", "cdf");
            add("application/x-cdlink", "vcd");
            add("application/x-chess-pgn", "pgn");
            add("application/x-cpio", "cpio");
            add("application/x-debian-package", "deb");
            add("application/x-debian-package", "udeb");
            add("application/x-director", "dcr");
            add("application/x-director", "dir");
            add("application/x-director", "dxr");
            add("application/x-dms", "dms");
            add("application/x-doom", "wad");
            add("application/x-dvi", "dvi");
            add("application/x-flac", "flac");
            add("application/x-font", "pfa");
            add("application/x-font", "pfb");
            add("application/x-font", "gsf");
            add("application/x-font", "pcf");
            add("application/x-font", "pcf.Z");
            add("application/x-freemind", "mm");
            add("application/x-futuresplash", "spl");
            add("application/x-gnumeric", "gnumeric");
            add("application/x-go-sgf", "sgf");
            add("application/x-graphing-calculator", "gcf");
            add("application/x-gtar", "gtar");
            add("application/x-gtar", "tgz");
            add("application/x-gtar", "taz");
            add("application/x-hdf", "hdf");
            add("application/x-ica", "ica");
            add("application/x-internet-signup", "ins");
            add("application/x-internet-signup", "isp");
            add("application/x-iphone", "iii");
            add("application/x-iso9660-image", "iso");
            add("application/x-jmol", "jmz");
            add("application/x-kchart", "chrt");
            add("application/x-killustrator", "kil");
            add("application/x-koan", "skp");
            add("application/x-koan", "skd");
            add("application/x-koan", "skt");
            add("application/x-koan", "skm");
            add("application/x-kpresenter", "kpr");
            add("application/x-kpresenter", "kpt");
            add("application/x-kspread", "ksp");
            add("application/x-kword", "kwd");
            add("application/x-kword", "kwt");
            add("application/x-latex", "latex");
            add("application/x-lha", "lha");
            add("application/x-lzh", "lzh");
            add("application/x-lzx", "lzx");
            add("application/x-maker", "frm");
            add("application/x-maker", "maker");
            add("application/x-maker", "frame");
            add("application/x-maker", "fb");
            add("application/x-maker", "book");
            add("application/x-maker", "fbdoc");
            add("application/x-mif", "mif");
            add("application/x-ms-wmd", "wmd");
            add("application/x-ms-wmz", "wmz");
            add("application/x-msi", "msi");
            add("application/x-ns-proxy-autoconfig", "pac");
            add("application/x-nwc", "nwc");
            add("application/x-object", "o");
            add("application/x-oz-application", "oza");
            add("application/x-pkcs12", "p12");
            add("application/x-pkcs7-certreqresp", "p7r");
            add("application/x-pkcs7-crl", "crl");
            add("application/x-quicktimeplayer", "qtl");
            add("application/x-shar", "shar");
            add("application/x-shockwave-flash", "swf");
            add("application/x-stuffit", "sit");
            add("application/x-sv4cpio", "sv4cpio");
            add("application/x-sv4crc", "sv4crc");
            add("application/x-tar", "tar");
            add("application/x-texinfo", "texinfo");
            add("application/x-texinfo", "texi");
            add("application/x-troff", "t");
            add("application/x-troff", "roff");
            add("application/x-troff-man", "man");
            add("application/x-ustar", "ustar");
            add("application/x-wais-source", "src");
            add("application/x-wingz", "wz");
            add("application/x-webarchive", "webarchive");
            add("application/x-webarchive-xml", "webarchivexml");
            add("application/x-x509-ca-cert", "crt");
            add("application/x-x509-user-cert", "crt");
            add("application/x-xcf", "xcf");
            add("application/x-xfig", "fig");
            add("application/xhtml+xml", "xhtml");
            add("audio/3gpp", "3gpp");
            add("audio/amr", "amr");
            add("audio/basic", "snd");
            add("audio/midi", "mid");
            add("audio/midi", "midi");
            add("audio/midi", "kar");
            add("audio/midi", "xmf");
            add("audio/mobile-xmf", "mxmf");
            add("audio/mpeg", "mpga");
            add("audio/mpeg", "mpega");
            add("audio/mpeg", "mp2");
            add("audio/mpeg", "mp3");
            add("audio/mpeg", "m4a");
            add("audio/mpegurl", "m3u");
            add("audio/prs.sid", "sid");
            add("audio/x-aiff", "aif");
            add("audio/x-aiff", "aiff");
            add("audio/x-aiff", "aifc");
            add("audio/x-gsm", "gsm");
            add("audio/x-mpegurl", "m3u");
            add("audio/x-ms-wma", "wma");
            add("audio/x-ms-wax", "wax");
            add("audio/x-pn-realaudio", "ra");
            add("audio/x-pn-realaudio", "rm");
            add("audio/x-pn-realaudio", "ram");
            add("audio/x-realaudio", "ra");
            add("audio/x-scpls", "pls");
            add("audio/x-sd2", "sd2");
            add("audio/x-wav", "wav");
            add("image/bmp", "bmp");
            add("audio/x-qcp", "qcp");
            add("image/gif", "gif");
            add("image/ico", "cur");
            add("image/ico", "ico");
            add("image/ief", "ief");
            add("image/jpeg", "jpeg");
            add("image/jpeg", "jpg");
            add("image/jpeg", "jpe");
            add("image/pcx", "pcx");
            add("image/png", "png");
            add("image/svg+xml", "svg");
            add("image/svg+xml", "svgz");
            add("image/tiff", "tiff");
            add("image/tiff", "tif");
            add("image/vnd.djvu", "djvu");
            add("image/vnd.djvu", "djv");
            add("image/vnd.wap.wbmp", "wbmp");
            add("image/x-cmu-raster", "ras");
            add("image/x-coreldraw", "cdr");
            add("image/x-coreldrawpattern", "pat");
            add("image/x-coreldrawtemplate", "cdt");
            add("image/x-corelphotopaint", "cpt");
            add("image/x-icon", "ico");
            add("image/x-jg", "art");
            add("image/x-jng", "jng");
            add("image/x-ms-bmp", "bmp");
            add("image/x-photoshop", "psd");
            add("image/x-portable-anymap", "pnm");
            add("image/x-portable-bitmap", "pbm");
            add("image/x-portable-graymap", "pgm");
            add("image/x-portable-pixmap", "ppm");
            add("image/x-rgb", "rgb");
            add("image/x-xbitmap", "xbm");
            add("image/x-xpixmap", "xpm");
            add("image/x-xwindowdump", "xwd");
            add("model/iges", "igs");
            add("model/iges", "iges");
            add("model/mesh", "msh");
            add("model/mesh", "mesh");
            add("model/mesh", "silo");
            add("text/calendar", "ics");
            add("text/calendar", "icz");
            add("text/comma-separated-values", "csv");
            add("text/css", "css");
            add("text/html", "htm");
            add("text/html", "html");
            add("text/h323", "323");
            add("text/iuls", "uls");
            add("text/mathml", "mml");
            // add ".txt" first so it will be the default for ExtensionFromMimeType
            add("text/plain", "txt");
            add("text/plain", "asc");
            add("text/plain", "text");
            add("text/plain", "diff");
            add("text/plain", "po");     // reserve "pot" for vnd.ms-powerpoint
            add("text/richtext", "rtx");
            add("text/rtf", "rtf");
            add("text/texmacs", "ts");
            add("text/text", "phps");
            add("text/tab-separated-values", "tsv");
            add("text/xml", "xml");
            add("text/x-bibtex", "bib");
            add("text/x-boo", "boo");
            add("text/x-c++hdr", "h++");
            add("text/x-c++hdr", "hpp");
            add("text/x-c++hdr", "hxx");
            add("text/x-c++hdr", "hh");
            add("text/x-c++src", "c++");
            add("text/x-c++src", "cpp");
            add("text/x-c++src", "cxx");
            add("text/x-chdr", "h");
            add("text/x-component", "htc");
            add("text/x-csh", "csh");
            add("text/x-csrc", "c");
            add("text/x-dsrc", "d");
            add("text/x-haskell", "hs");
            add("text/x-java", "java");
            add("text/x-literate-haskell", "lhs");
            add("text/x-moc", "moc");
            add("text/x-pascal", "p");
            add("text/x-pascal", "pas");
            add("text/x-pcs-gcd", "gcd");
            add("text/x-setext", "etx");
            add("text/x-tcl", "tcl");
            add("text/x-tex", "tex");
            add("text/x-tex", "ltx");
            add("text/x-tex", "sty");
            add("text/x-tex", "cls");
            add("text/x-vcalendar", "vcs");
            add("text/x-vcard", "vcf");
            add("video/3gpp", "3gpp");
            add("video/3gpp", "3gp");
            add("video/3gpp", "3g2");
            add("video/dl", "dl");
            add("video/dv", "dif");
            add("video/dv", "dv");
            add("video/fli", "fli");
            add("video/m4v", "m4v");
            add("video/mpeg", "mpeg");
            add("video/mpeg", "mpg");
            add("video/mpeg", "mpe");
            add("video/mp4", "mp4");
            add("video/mpeg", "VOB");
            add("video/quicktime", "qt");
            add("video/quicktime", "mov");
            add("video/vnd.mpegurl", "mxu");
            add("video/webm", "webm");
            add("video/x-la-asf", "lsf");
            add("video/x-la-asf", "lsx");
            add("video/x-mng", "mng");
            add("video/x-ms-asf", "asf");
            add("video/x-ms-asf", "asx");
            add("video/x-ms-wm", "wm");
            add("video/x-ms-wmv", "wmv");
            add("video/x-ms-wmx", "wmx");
            add("video/x-ms-wvx", "wvx");
            add("video/x-msvideo", "avi");
            add("video/x-sgi-movie", "movie");
            add("x-conference/x-cooltalk", "ice");
            add("x-epoc/x-sisx-app", "sisx");
            applyOverrides();
        }
    
        private static void add(String mimeType, String extension) {
            //
            // if we have an existing x --> y mapping, we do not want to
            // override it with another mapping x --> ?
            // this is mostly because of the way the mime-type map below
            // is constructed (if a mime type maps to several extensions
            // the first extension is considered the most popular and is
            // added first; we do not want to overwrite it later).
            //
            if (!mimeTypeToExtensionMap.containsKey(mimeType)) {
                mimeTypeToExtensionMap.put(mimeType, extension);
            }
            extensionToMimeTypeMap.put(extension, mimeType);
        }
    
        private static InputStream getContentTypesPropertiesStream() {
            // User override?
            String userTable = System.getProperty("content.types.user.table");
            if (userTable != null) {
                File f = new File(userTable);
                if (f.exists()) {
                    try {
                        return new FileInputStream(f);
                    } catch (IOException ignored) {
                    }
                }
            }
    
            // Standard location?
            File f = new File(System.getProperty("java.home"), "lib" + File.separator + "content-types.properties");
            if (f.exists()) {
                try {
                    return new FileInputStream(f);
                } catch (IOException ignored) {
                }
            }
    
            return null;
        }
    
        /**
         * This isn't what the RI does. The RI doesn't have hard-coded defaults, so supplying your
         * own "content.types.user.table" means you don't get any of the built-ins, and the built-ins
         * come from "$JAVA_HOME/lib/content-types.properties".
         */
        private static void applyOverrides() {
            // Get the appropriate InputStream to read overrides from, if any.
            InputStream stream = getContentTypesPropertiesStream();
            if (stream == null) {
                return;
            }
    
            try {
                try {
                    // Read the properties file...
                    Properties overrides = new Properties();
                    overrides.load(stream);
                    // And translate its mapping to ours...
                    for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                        String extension = (String) entry.getKey();
                        String mimeType = (String) entry.getValue();
                        add(mimeType, extension);
                    }
                } finally {
                    stream.close();
                }
            } catch (IOException ignored) {
            }
        }
    
        private MimeUtils() {
        }
    
        /**
         * Returns true if the given MIME type has an entry in the map.
         * @param mimeType A MIME type (i.e. text/plain)
         * @return True iff there is a mimeType entry in the map.
         */
        public static boolean hasMimeType(String mimeType) {
            if (mimeType == null || mimeType.isEmpty()) {
                return false;
            }
            return mimeTypeToExtensionMap.containsKey(mimeType);
        }
    
        /**
         * Returns the MIME type for the given extension.
         * @param extension A file extension without the leading '.'
         * @return The MIME type for the given extension or null iff there is none.
         */
        public static String guessMimeTypeFromExtension(String extension) {
            if (extension == null || extension.isEmpty()) {
                return null;
            }
            return extensionToMimeTypeMap.get(extension);
        }
    
        /**
         * Returns true if the given extension has a registered MIME type.
         * @param extension A file extension without the leading '.'
         * @return True iff there is an extension entry in the map.
         */
        public static boolean hasExtension(String extension) {
            if (extension == null || extension.isEmpty()) {
                return false;
            }
            return extensionToMimeTypeMap.containsKey(extension);
        }
    
        /**
         * Returns the registered extension for the given MIME type. Note that some
         * MIME types map to multiple extensions. This call will return the most
         * common extension for the given MIME type.
         * @param mimeType A MIME type (i.e. text/plain)
         * @return The extension for the given MIME type or null iff there is none.
         */
        public static String guessExtensionFromMimeType(String mimeType) {
            if (mimeType == null || mimeType.isEmpty()) {
                return null;
            }
            return mimeTypeToExtensionMap.get(mimeType);
        }
    }
    

    键值对颠倒整理

    ("ez","application/andrew-inset")
    ("tsp","application/dsptype")
    ("spl","application/futuresplash")
    ("hta","application/hta")
    ("hqx","application/mac-binhex40")
    ("cpt","application/mac-compactpro")
    ("nb","application/mathematica")
    ("mdb","application/msaccess")
    ("oda","application/oda")
    ("ogg","application/ogg")
    ("pdf","application/pdf")
    ("key","application/pgp-keys")
    ("pgp","application/pgp-signature")
    ("prf","application/pics-rules")
    ("rar","application/rar")
    ("rdf","application/rdf+xml")
    ("rss","application/rss+xml")
    ("zip","application/zip")
    ("apk","application/vnd.android.package-archive")
    ("cdy","application/vnd.cinderella")
    ("stl","application/vnd.ms-pki.stl")
    ("odb","application/vnd.oasis.opendocument.database")
    ("odf","application/vnd.oasis.opendocument.formula")
    ("odg","application/vnd.oasis.opendocument.graphics")
    ("otg","application/vnd.oasis.opendocument.graphics-template")
    ("odi","application/vnd.oasis.opendocument.image")
    ("ods","application/vnd.oasis.opendocument.spreadsheet")
    ("ots","application/vnd.oasis.opendocument.spreadsheet-template")
    ("odt","application/vnd.oasis.opendocument.text")
    ("odm","application/vnd.oasis.opendocument.text-master")
    ("ott","application/vnd.oasis.opendocument.text-template")
    ("oth","application/vnd.oasis.opendocument.text-web")
    ("kml","application/vnd.google-earth.kml+xml")
    ("kmz","application/vnd.google-earth.kmz")
    ("doc","application/msword")
    ("dot","application/msword")
    ("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document")
    ("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template")
    ("xls","application/vnd.ms-excel")
    ("xlt","application/vnd.ms-excel")
    ("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
    ("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template")
    ("ppt","application/vnd.ms-powerpoint")
    ("pot","application/vnd.ms-powerpoint")
    ("pps","application/vnd.ms-powerpoint")
    ("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation")
    ("potx","application/vnd.openxmlformats-officedocument.presentationml.template")
    ("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow")
    ("cod","application/vnd.rim.cod")
    ("mmf","application/vnd.smaf")
    ("sdc","application/vnd.stardivision.calc")
    ("sda","application/vnd.stardivision.draw")
    ("sdd","application/vnd.stardivision.impress")
    ("sdp","application/vnd.stardivision.impress")
    ("smf","application/vnd.stardivision.math")
    ("sdw","application/vnd.stardivision.writer")
    ("vor","application/vnd.stardivision.writer")
    ("sgl","application/vnd.stardivision.writer-global")
    ("sxc","application/vnd.sun.xml.calc")
    ("stc","application/vnd.sun.xml.calc.template")
    ("sxd","application/vnd.sun.xml.draw")
    ("std","application/vnd.sun.xml.draw.template")
    ("sxi","application/vnd.sun.xml.impress")
    ("sti","application/vnd.sun.xml.impress.template")
    ("sxm","application/vnd.sun.xml.math")
    ("sxw","application/vnd.sun.xml.writer")
    ("sxg","application/vnd.sun.xml.writer.global")
    ("stw","application/vnd.sun.xml.writer.template")
    ("vsd","application/vnd.visio")
    ("abw","application/x-abiword")
    ("dmg","application/x-apple-diskimage")
    ("bcpio","application/x-bcpio")
    ("torrent","application/x-bittorrent")
    ("cdf","application/x-cdf")
    ("vcd","application/x-cdlink")
    ("pgn","application/x-chess-pgn")
    ("cpio","application/x-cpio")
    ("deb","application/x-debian-package")
    ("udeb","application/x-debian-package")
    ("dcr","application/x-director")
    ("dir","application/x-director")
    ("dxr","application/x-director")
    ("dms","application/x-dms")
    ("wad","application/x-doom")
    ("dvi","application/x-dvi")
    ("flac","application/x-flac")
    ("pfa","application/x-font")
    ("pfb","application/x-font")
    ("gsf","application/x-font")
    ("pcf","application/x-font")
    ("pcf.z","application/x-font")
    ("mm","application/x-freemind")
    ("spl","application/x-futuresplash")
    ("gnumeric","application/x-gnumeric")
    ("sgf","application/x-go-sgf")
    ("gcf","application/x-graphing-calculator")
    ("gtar","application/x-gtar")
    ("tgz","application/x-gtar")
    ("taz","application/x-gtar")
    ("hdf","application/x-hdf")
    ("ica","application/x-ica")
    ("ins","application/x-internet-signup")
    ("isp","application/x-internet-signup")
    ("iii","application/x-iphone")
    ("iso","application/x-iso9660-image")
    ("jmz","application/x-jmol")
    ("chrt","application/x-kchart")
    ("kil","application/x-killustrator")
    ("skp","application/x-koan")
    ("skd","application/x-koan")
    ("skt","application/x-koan")
    ("skm","application/x-koan")
    ("kpr","application/x-kpresenter")
    ("kpt","application/x-kpresenter")
    ("ksp","application/x-kspread")
    ("kwd","application/x-kword")
    ("kwt","application/x-kword")
    ("latex","application/x-latex")
    ("lha","application/x-lha")
    ("lzh","application/x-lzh")
    ("lzx","application/x-lzx")
    ("frm","application/x-maker")
    ("maker","application/x-maker")
    ("frame","application/x-maker")
    ("fb","application/x-maker")
    ("book","application/x-maker")
    ("fbdoc","application/x-maker")
    ("mif","application/x-mif")
    ("wmd","application/x-ms-wmd")
    ("wmz","application/x-ms-wmz")
    ("msi","application/x-msi")
    ("pac","application/x-ns-proxy-autoconfig")
    ("nwc","application/x-nwc")
    ("o","application/x-object")
    ("oza","application/x-oz-application")
    ("p12","application/x-pkcs12")
    ("p7r","application/x-pkcs7-certreqresp")
    ("crl","application/x-pkcs7-crl")
    ("qtl","application/x-quicktimeplayer")
    ("shar","application/x-shar")
    ("swf","application/x-shockwave-flash")
    ("sit","application/x-stuffit")
    ("sv4cpio","application/x-sv4cpio")
    ("sv4crc","application/x-sv4crc")
    ("tar","application/x-tar")
    ("texinfo","application/x-texinfo")
    ("texi","application/x-texinfo")
    ("t","application/x-troff")
    ("roff","application/x-troff")
    ("man","application/x-troff-man")
    ("ustar","application/x-ustar")
    ("src","application/x-wais-source")
    ("wz","application/x-wingz")
    ("webarchive","application/x-webarchive")
    ("webarchivexml","application/x-webarchive-xml")
    ("crt","application/x-x509-ca-cert")
    ("crt","application/x-x509-user-cert")
    ("xcf","application/x-xcf")
    ("fig","application/x-xfig")
    ("xhtml","application/xhtml+xml")
    ("3gpp","audio/3gpp")
    ("amr","audio/amr")
    ("snd","audio/basic")
    ("mid","audio/midi")
    ("midi","audio/midi")
    ("kar","audio/midi")
    ("xmf","audio/midi")
    ("mxmf","audio/mobile-xmf")
    ("mpga","audio/mpeg")
    ("mpega","audio/mpeg")
    ("mp2","audio/mpeg")
    ("mp3","audio/mpeg")
    ("m4a","audio/mpeg")
    ("m3u","audio/mpegurl")
    ("sid","audio/prs.sid")
    ("aif","audio/x-aiff")
    ("aiff","audio/x-aiff")
    ("aifc","audio/x-aiff")
    ("gsm","audio/x-gsm")
    ("m3u","audio/x-mpegurl")
    ("wma","audio/x-ms-wma")
    ("wax","audio/x-ms-wax")
    ("ra","audio/x-pn-realaudio")
    ("rm","audio/x-pn-realaudio")
    ("ram","audio/x-pn-realaudio")
    ("ra","audio/x-realaudio")
    ("pls","audio/x-scpls")
    ("sd2","audio/x-sd2")
    ("wav","audio/x-wav")
    ("bmp","image/bmp")
    ("qcp","audio/x-qcp")
    ("gif","image/gif")
    ("cur","image/ico")
    ("ico","image/ico")
    ("ief","image/ief")
    ("jpeg","image/jpeg")
    ("jpg","image/jpeg")
    ("jpe","image/jpeg")
    ("pcx","image/pcx")
    ("png","image/png")
    ("svg","image/svg+xml")
    ("svgz","image/svg+xml")
    ("tiff","image/tiff")
    ("tif","image/tiff")
    ("djvu","image/vnd.djvu")
    ("djv","image/vnd.djvu")
    ("wbmp","image/vnd.wap.wbmp")
    ("ras","image/x-cmu-raster")
    ("cdr","image/x-coreldraw")
    ("pat","image/x-coreldrawpattern")
    ("cdt","image/x-coreldrawtemplate")
    ("cpt","image/x-corelphotopaint")
    ("ico","image/x-icon")
    ("art","image/x-jg")
    ("jng","image/x-jng")
    ("bmp","image/x-ms-bmp")
    ("psd","image/x-photoshop")
    ("pnm","image/x-portable-anymap")
    ("pbm","image/x-portable-bitmap")
    ("pgm","image/x-portable-graymap")
    ("ppm","image/x-portable-pixmap")
    ("rgb","image/x-rgb")
    ("xbm","image/x-xbitmap")
    ("xpm","image/x-xpixmap")
    ("xwd","image/x-xwindowdump")
    ("igs","model/iges")
    ("iges","model/iges")
    ("msh","model/mesh")
    ("mesh","model/mesh")
    ("silo","model/mesh")
    ("ics","text/calendar")
    ("icz","text/calendar")
    ("csv","text/comma-separated-values")
    ("css","text/css")
    ("htm","text/html")
    ("html","text/html")
    ("323","text/h323")
    ("uls","text/iuls")
    ("mml","text/mathml")
    ("txt","text/plain")
    ("asc","text/plain")
    ("text","text/plain")
    ("diff","text/plain")
    ("po","text/plain")
    ("rtx","text/richtext")
    ("rtf","text/rtf")
    ("ts","text/texmacs")
    ("phps","text/text")
    ("tsv","text/tab-separated-values")
    ("xml","text/xml")
    ("bib","text/x-bibtex")
    ("boo","text/x-boo")
    ("h++","text/x-c++hdr")
    ("hpp","text/x-c++hdr")
    ("hxx","text/x-c++hdr")
    ("hh","text/x-c++hdr")
    ("c++","text/x-c++src")
    ("cpp","text/x-c++src")
    ("cxx","text/x-c++src")
    ("h","text/x-chdr")
    ("htc","text/x-component")
    ("csh","text/x-csh")
    ("c","text/x-csrc")
    ("d","text/x-dsrc")
    ("hs","text/x-haskell")
    ("java","text/x-java")
    ("lhs","text/x-literate-haskell")
    ("moc","text/x-moc")
    ("p","text/x-pascal")
    ("pas","text/x-pascal")
    ("gcd","text/x-pcs-gcd")
    ("etx","text/x-setext")
    ("tcl","text/x-tcl")
    ("tex","text/x-tex")
    ("ltx","text/x-tex")
    ("sty","text/x-tex")
    ("cls","text/x-tex")
    ("vcs","text/x-vcalendar")
    ("vcf","text/x-vcard")
    ("3gpp","video/3gpp")
    ("3gp","video/3gpp")
    ("3g2","video/3gpp")
    ("dl","video/dl")
    ("dif","video/dv")
    ("dv","video/dv")
    ("fli","video/fli")
    ("m4v","video/m4v")
    ("mpeg","video/mpeg")
    ("mpg","video/mpeg")
    ("mpe","video/mpeg")
    ("mp4","video/mp4")
    ("vob","video/mpeg")
    ("qt","video/quicktime")
    ("mov","video/quicktime")
    ("mxu","video/vnd.mpegurl")
    ("webm","video/webm")
    ("lsf","video/x-la-asf")
    ("lsx","video/x-la-asf")
    ("mng","video/x-mng")
    ("asf","video/x-ms-asf")
    ("asx","video/x-ms-asf")
    ("wm","video/x-ms-wm")
    ("wmv","video/x-ms-wmv")
    ("wmx","video/x-ms-wmx")
    ("wvx","video/x-ms-wvx")
    ("avi","video/x-msvideo")
    ("movie","video/x-sgi-movie")
    ("ice","x-conference/x-cooltalk")
    ("sisx","x-epoc/x-sisx-app")
    
    
    //一下重复内容仅仅是有两项重复了
    //E/查重: spl
    //E/查重: cpt
    //E/查重: crt
    //E/查重: 3gpp
    //E/查重: m3u
    //E/查重: ra
    //E/查重: bmp
    //E/查重: ico

    提问:同一个后缀名对应多个MIME值是什么情况,怎么解释。希望有明白的能留言交流。

    展开全文
  • MIME类型

    千次阅读 2018-11-28 15:19:17
    浏览器通常使用MIME类型(而不是文件扩展名)来确定如何处理文档;因此服务器设置正确以将正确的MIME类型附加到响应对象的头部是非常重要的。 2.语法 通用结构 type/subtype MIME的组成结构非常简单;由...
  • 各种文件类型对应的MIME类型

    千次阅读 2014-09-22 08:42:21
    各种后缀对应的小类型  'chm'=>'application/octet-stream',  'ppt'=>'application/vnd.ms-powerpoint',  'xls'=>'application/vnd.ms-excel',  'doc'=>'application/msword',  'exe'=>'application/octet...
  • 常用MIME类型(Mp4的mime类型设置)

    万次阅读 2016-11-07 18:06:54
    常用MIME类型MIME类型设置大全。mime type:application/octet-stream:任意的二进制文件(通常做为通知浏览器下载文件);video/mp4:MP4视频文件
  • JSON 的 MIME 类型

    万次阅读 2014-09-12 16:10:08
    JSON 的 MIME 类型是 application/json 参见: JSON:
  • 新的MIME类型, 扩展名中填 .apkMIME类型中填写apk的MIME类型 application/vnd.android.package-archive保存设置。
  • 参考了以下网址。 ... 在注册表中,比较一下图中与网页中是否一致。修改完成后,重启。 ...过滤器处做了修改,如下: ...if (requestURI.contains(".css") || requestURI.contains(".js")) ... chain.doFilter(...
  • IIS中添加Mime扩展类型MP4

    万次阅读 2018-04-24 17:32:55
    application/mp4
  • 找到IIS,设置下MIME类型,里面添加个  文件扩展名 : .mp4   MIME :video/MP4   即可,解决这个问题。
  • 解析Json需要设置Mime

    万次阅读 2014-02-12 11:18:31
    内容类型(MIME):application/x-javascript  2.添加映射: 位置在IIS对应站点右键属性:”主目录”-”应用程序设置”-”配置”-”映射”-”添加”,会打开”添加/编辑应用程序扩展名映射” 扩展名:.json 运行文件...
  • IIS——MIME介绍与添加MIME类型

    万次阅读 2017-03-20 17:19:35
    MIME(MultipurposeInternet Mail Extensions)多用途互联网邮件扩展类型。是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问的时候,浏览器会自动使用指定应用程序来打开。多用于指定一些...
  • php 获取文件mime类型的方法

    万次阅读 2014-12-26 00:04:46
    php 获取文件mime类型的方法 1.使用 mime_content_type 方法 2.使用 Fileinfo 方法 (官方推荐) 3.使用 image_type_to_mime_type 方法(只能处理图象类型)
  • 本地测试插入的视频可以播放,但上线后就播放不了? case:使用html5视频标签...R:这种情况是因为项目里“mime类型”缺少要播放视频的格式,在IIS里添加相关mime类型 文件扩展名:.mp4 MIME 类型:video/m...
  • 即使其 MIME 类型(“text/html”)不是有效的 JavaScript MIME 类型,仍已加载XXX的文件 报这个错时在网页查看一下源代码 F12查看 仔细查看自己的引入jquery路径是否正确,我是少加了一个/ 希望你能有所收获! ...
  • 很多时候,会遇到使用Jmeter进行文件的上传。  下面就一张图片介绍,如何实现文件的上传。  确保在进行此操作前,图片show.png 已经存在于测试PC上。...注意:MIME 类型填入:application/octet-stream
  • 常用的视频格式mime设置

    千次阅读 2016-03-06 12:06:04
    flv格式是加入关联扩展名:.flv,内容类型:application/octet-stream f4v格式是扩展名:.f4v,内容类型:application/octet-stream mp4格式是扩展名:.mp4,内容类型:video/mp4 ogv格式是扩展名:.ogv ,内容...
  • 在iis7中默认的mime类型并不包含所有的后缀名文件,像现在比较热门的apk,ipa文件都是需要手动添加的。至于添加的方法百度一下大家就都知道到了,这里小编要说的是,如果你的iis7中有很多个网站都需要设置mime类型,...
1 2 3 4 5 ... 20
收藏数 149,468
精华内容 59,787
关键字:

mime类型