`
canofy
  • 浏览: 829677 次
  • 性别: Icon_minigender_1
  • 来自: 北京、四川
社区版块
存档分类
最新评论

MIME TYPE

    博客分类:
  • j2EE
阅读更多

最近要做需要在页面上放音频的东西,因此需要用到mime type,开始还想把音频做成下载的方式,但这种方式在交互方式上存在着比较大的问题,因此必须得放弃。而在页面中调用的话开始还以为必须是一个文件,后来才知道只需把相应的servlet的mime type设置为支持wav的方式就可以了。在此记录一下mime type的介绍吧


常见MIME类型例表:

序号

内容类型

文件扩展名

描述

1

application/msword

doc

Microsoft Word

2

application/octet-stream bin

dms lha lzh exe class

可执行程序

3

application/pdf

pdf

Adobe Acrobat

4

application/postscript

ai eps ps

PostScript

5

appication/powerpoint

ppt

Microsoft Powerpoint

6

appication/rtf

rtf

rtf 格式

7

appication/x-compress

z

unix 压缩文件

8

application/x-gzip

gz

gzip

9

application/x-gtar

gtar

tar 文档 (gnu 格式 )

10

application/x-shockwave-flash

swf

MacroMedia Flash

11

application/x-tar

tar

tar(4.3BSD)

12

application/zip

zip

winzip

13

audio/basic

au snd

sun/next 声音文件

14

audio/mpeg

mpeg mp2

Mpeg 声音文件

15

audio/x-aiff

mid midi rmf

Midi 格式

16

audio/x-pn-realaudio

ram ra

Real Audio 声音

17

audio/x-pn-realaudio-plugin

rpm

Real Audio 插件

18

audio/x-wav

wav

Microsoft Windows 声音

19

image/cgm

cgm

计算机图形元文件

20

image/gif

gif

COMPUSERVE GIF 图像

21

image/jpeg

jpeg jpg jpe

JPEG 图像

22

image/png

png

PNG 图像

 

 

amr       audio/amr

pmd      audio/pmd

3gp        video/3gpp

cab        application/vnd.smartpohone

hme      application/vnd.smartphone.thm

jad         text/vnd.sun.j2me.app-descriptor

jar         application/java-archive

mp3    audio/x-mpeg

mp4     video/mp4

ogg       application/ogg

pdb      application/ebook

rm        video/rm

rng       application/vnd.nokia.ringing-tone

sdt        application/vnd.sie.thm

sisx       x-epoc/x-sisx-app

sis         application/vnd.symbian.install

thm     application/vnd.eri.thm

tsk       application/vnd.ppc.thm

umd     application/umd

utz        application/vnd.uiq.thm

exe      application/ocelet-stream

rar      application/ocelet-stream

hqx      application/mac-binhex40 
bin       application/octet-stream
oda      application/oda
pdf     application/pdf
ai         application/postsrcipt
eps     application/postsrcipt
es      application/postsrcipt
rtf       application/rtf
mif      application/x-mif
csh     application/x-csh
dvi     application/x-dvi
hdf     application/x-hdf
nc       application/x-netcdf
cdf      application/x-netcdf
latex     application/x-latex
ts         application/x-troll-ts
src       application/x-wais-source
zip       application/zip
bcpio     application/x-bcpio
cpio     application/x-cpio
gtar     application/x-gtar
shar     application/x-shar
sv4cpio     application/x-sv4cpio
sv4crc    application/x-sv4crc
tar        application/x-tar
ustar    application/x-ustar
man     application/x-troff-man
sh          application/x-sh
tcl          application/x-tcl
tex         application/x-tex
texi         application/x-texinfo
texinfo     application/x-texinfo
t            application/x-troff
tr          application/x-troff
roff       application/x-troff
shar     application/x-shar
me      application/x-troll-me
ts      application/x-troll-ts
gif       image/gif
jpeg     image/pjpeg
jpg     image/pjpeg
jpe      image/pjpeg
ras      image/x-cmu-raster
pbm     image/x-portable-bitmap
ppm    image/x-portable-pixmap
xbm     image/x-xbitmap
xwd     image/x-xwindowdump
ief        image/ief
tif         image/tiff
tiff        image/tiff
pnm     image/x-portable-anymap
pgm     image/x-portable-graymap
rgb      image/x-rgb
xpm    image/x-xpixmap
txt        text/plain
c             text/plain
cc          text/plain
h            text/plain
html     text/html
htm       text/html
htl          text/html
rtx         text/richtext
etx        text/x-setext
tsv         text/tab-separated-values
mpeg    video/mpeg
avi         video/avi
rm         video/rm
rmvb     video/rmvb
wmv     video/x-ms-wmv
flv         application/octet-stream
mpg      video/mpeg
mpe     video/mpeg
avi       video/x-msvideo
qt         video/quicktime
mov     video/quicktime
moov     video/quicktime
movie    video/x-sgi-movie
au         audio/basic
mp3     audio/mp3
snd       audio/basic
wav     audio/wav
wma     audio/x-ms-wma
aif         audio/x-aiff
aiff     audio/x-aiff
aifc      audio/x-aiff
swf      application/x-shockwave-flash
doc       application/msword
ini        application/octet-stream

 


下面一段摘自tomcat的conf/web.xml

<mime-mapping>
        <extension>abs</extension>
        <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>ai</extension>
        <mime-type>application/postscript</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>aif</extension>
        <mime-type>audio/x-aiff</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>aifc</extension>
        <mime-type>audio/x-aiff</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>aiff</extension>
        <mime-type>audio/x-aiff</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>aim</extension>
        <mime-type>application/x-aim</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>art</extension>
        <mime-type>image/x-jg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>asf</extension>
        <mime-type>video/x-ms-asf</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>asx</extension>
        <mime-type>video/x-ms-asf</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>au</extension>
        <mime-type>audio/basic</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>avi</extension>
        <mime-type>video/x-msvideo</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>avx</extension>
        <mime-type>video/x-rad-screenplay</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>bcpio</extension>
        <mime-type>application/x-bcpio</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>bin</extension>
        <mime-type>application/octet-stream</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>bmp</extension>
        <mime-type>image/bmp</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>body</extension>
        <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>cdf</extension>
        <mime-type>application/x-cdf</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>cer</extension>
        <mime-type>application/x-x509-ca-cert</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>class</extension>
        <mime-type>application/java</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>cpio</extension>
        <mime-type>application/x-cpio</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>csh</extension>
        <mime-type>application/x-csh</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>css</extension>
        <mime-type>text/css</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>dib</extension>
        <mime-type>image/bmp</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>doc</extension>
        <mime-type>application/msword</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>dtd</extension>
        <mime-type>application/xml-dtd</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>dv</extension>
        <mime-type>video/x-dv</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>dvi</extension>
        <mime-type>application/x-dvi</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>eps</extension>
        <mime-type>application/postscript</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>etx</extension>
        <mime-type>text/x-setext</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>exe</extension>
        <mime-type>application/octet-stream</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>gif</extension>
        <mime-type>image/gif</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>gtar</extension>
        <mime-type>application/x-gtar</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>gz</extension>
        <mime-type>application/x-gzip</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>hdf</extension>
        <mime-type>application/x-hdf</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>hqx</extension>
        <mime-type>application/mac-binhex40</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>htc</extension>
        <mime-type>text/x-component</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>htm</extension>
        <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>html</extension>
        <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>hqx</extension>
        <mime-type>application/mac-binhex40</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>ief</extension>
        <mime-type>image/ief</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jad</extension>
        <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jar</extension>
        <mime-type>application/java-archive</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>java</extension>
        <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jnlp</extension>
        <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jpe</extension>
        <mime-type>image/jpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jpeg</extension>
        <mime-type>image/jpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jpg</extension>
        <mime-type>image/jpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>js</extension>
        <mime-type>text/javascript</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jsf</extension>
        <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>jspf</extension>
        <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>kar</extension>
        <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>latex</extension>
        <mime-type>application/x-latex</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>m3u</extension>
        <mime-type>audio/x-mpegurl</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mac</extension>
        <mime-type>image/x-macpaint</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>man</extension>
        <mime-type>application/x-troff-man</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mathml</extension>
        <mime-type>application/mathml+xml</mime-type> 
    </mime-mapping>
    <mime-mapping>
        <extension>me</extension>
        <mime-type>application/x-troff-me</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mid</extension>
        <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>midi</extension>
        <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mif</extension>
        <mime-type>application/x-mif</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mov</extension>
        <mime-type>video/quicktime</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>movie</extension>
        <mime-type>video/x-sgi-movie</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mp1</extension>
        <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mp2</extension>
        <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mp3</extension>
        <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mp4</extension>
        <mime-type>video/mp4</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mpa</extension>
        <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mpe</extension>
        <mime-type>video/mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mpeg</extension>
        <mime-type>video/mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mpega</extension>
        <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mpg</extension>
        <mime-type>video/mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>mpv2</extension>
        <mime-type>video/mpeg2</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>ms</extension>
        <mime-type>application/x-wais-source</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>nc</extension>
        <mime-type>application/x-netcdf</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>oda</extension>
        <mime-type>application/oda</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Database -->
        <extension>odb</extension>
        <mime-type>application/vnd.oasis.opendocument.database</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Chart -->
        <extension>odc</extension>
        <mime-type>application/vnd.oasis.opendocument.chart</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Formula -->
        <extension>odf</extension>
        <mime-type>application/vnd.oasis.opendocument.formula</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Drawing -->
        <extension>odg</extension>
        <mime-type>application/vnd.oasis.opendocument.graphics</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Image -->
        <extension>odi</extension>
        <mime-type>application/vnd.oasis.opendocument.image</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Master Document -->
        <extension>odm</extension>
        <mime-type>application/vnd.oasis.opendocument.text-master</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Presentation -->
        <extension>odp</extension>
        <mime-type>application/vnd.oasis.opendocument.presentation</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Spreadsheet -->
        <extension>ods</extension>
        <mime-type>application/vnd.oasis.opendocument.spreadsheet</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Text -->
        <extension>odt</extension>
        <mime-type>application/vnd.oasis.opendocument.text</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>ogg</extension>
        <mime-type>application/ogg</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Drawing Template -->
        <extension>otg </extension>
        <mime-type>application/vnd.oasis.opendocument.graphics-template</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- HTML Document Template -->
        <extension>oth</extension>
        <mime-type>application/vnd.oasis.opendocument.text-web</mime-type>
    </mime-mapping>
    <mime-mapping>
        <!-- OpenDocument Presentation Template -->
        <extension>otp</extension>
        <mime-type>application/vnd.oasis.opend

  


  
分享到:
评论

相关推荐

    MimeType文件校验demo

    在IT行业中,MimeType(MIME类型)是一种标准,用于标识互联网上的文件类型和编码方式。MimeType文件校验是网络服务中常见的操作,特别是在处理用户上传的文件时,它能确保服务器正确地解析和处理文件。本示例"Mime...

    常用的MIME TYPE类型枚举类Enum整理 静态方法直接检索使用

    示例代码:String mimeType = MimeTypeEnum.getMimeTypeBySuffix("txt"); 不仅是一款实用的开发工具,更是代码整洁与项目高效管理的体现。通过它,可以专注于业务逻辑的实现,而将MIME类型管理的繁杂细节交给我们。...

    常用文件的mime和mimetype.txt

    常用文件的mime和mimetype,几乎包括所有文件,大概有1000多项

    php获得文件的mime type类.zip

    $mimeType = MimeTypeDetector::detectMimeType($filePath); echo "File MIME Type: " . $mimeType; ``` 在实际开发中,可以根据项目需求进一步优化这个类,例如增加对大型文件的支持,避免一次性加载整个文件,...

    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type

    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1760344884.1407394057461" 第一步:需要先grantq权限: EXEC dbms_java.grant_...

    php获得文件的mime type类

    $mimeType = finfo_file($finfo, $file); // 获取MIME类型 finfo_close($finfo); // 关闭fileinfo对象 ``` 这种方法基于文件内容来判断MIME类型,准确度较高。 2. **`mime_content_type()`** 函数:这是一个较旧但...

    关于mime type的文章

    标题“关于mime type的文章”指出,我们即将探讨的是MIME类型(Multipurpose Internet Mail Extensions)的相关知识。MIME类型是互联网标准,用于标识通过网络传输的数据类型,比如在电子邮件、HTTP协议中,以及在...

    MimeType列表 20201005版本

    常见文件的扩展名对应mimetype的对应关系列表,csv格式可使用excel打开,方便查看。或者制作成项目内工具类调用判断。

    MIME Type 常見的格式類型列表

    ### MIME Type 常见的格式类型列表 MIME(Multipurpose Internet Mail Extensions)类型是一种标准,用于定义互联网上传输的不同数据格式。随着互联网技术的发展,MIME规范也在不断发展和完善中,因此MIME类型可能...

    mime type类型详解

    详细列出mime的所有文件类型 开发必备技术文档 尤其是页面下载文件、数据存储文件的metadata数据

    mime type 与 扩展名对应表

    最全的Mime type 和扩展名的对应表,媒体解析,流媒体开发不可或缺的资料。

    根据文件扩展名解析并返回对应的内容类型MIME Type

    【根据文件扩展名解析并返回对应的内容类型MIME Type】 常见的Microsoft Office文件类型有:doc、docx、xls、xlsx、ppt、pptx等 常见的Pdf文件类型有:pdf 常见的图像文件类型有:png、jpg、jpeg、gif等 常见的...

    Java 读取图片的mimeType的方法

    Java 读取图片的mimeType的方法 Java 读取图片的mimeType的方法是指通过编解码的方式判断图片是否合法,从而获取图片的mimeType。这种方法可以避免通过文件后缀名来判断图片格式的不可靠性。下面是 Java 读取图片...

    Http MIME type

    MIME类型的基本格式是“type/subtype”,其中“type”代表数据的主要类型,而“subtype”则进一步指明数据的具体格式。常见的类型包括文本(text)、音频(audio)、视频(video)、应用程序(application)等。 在Web开发...

    mimetype-js:用于将文件扩展名映射到其 MIME 类型字符串的 MIME 类型目录

    mimetype-js概述我发现继续为MIME类型制作这些文件扩展名查找表。 是时候把它放在一个模块中来省去麻烦了。例子一般情况var mimetype = require ( 'mimetype' ) ;console . log ( mimetype . lookup ( "myfile.txt" ...

    PyPI 官网下载 | mimetype_description-0.0.5-py3-none-any.whl

    标题中的“PyPI 官网下载 | mimetype_description-0.0.5-py3-none-any.whl”表明这是一个从Python Package Index(PyPI)官方源下载的软件包,名为`mimetype_description`,版本为0.0.5,适配Python 3环境,且不依赖...

    java-enum-mimetype:MIME 类型的 Java 枚举类

    MimeType mimeType = MimeType.fromString("image/jpeg"); response.setContentType(mimeType.getValue()); ``` `java-enum-mimetype-master`项目很可能是包含了这个枚举类实现的源代码,可能还包含了一些测试...

    web.xml 最全 MIME Type Mappings

    web.xml 最全 MIME Type Mappings 大概有 一千多个

    MIME-type MIME-type MIME-type MIME-type

    根据提供的文件信息,我们可以深入探讨MIME类型(Multipurpose Internet Mail Extensions)的相关知识点。MIME类型主要用于描述网络文件的格式,通常在网络传输中用于告诉接收方如何解释数据。以下是对标题、描述及...

    web.xml中的mime-type标签作用与使用

    ### Web.xml中的MIME-Type标签作用与使用详解 在Java Web开发中,`web.xml`配置文件扮演着至关重要的角色。它定义了Web应用程序的基本结构和行为,包括Servlet的映射、过滤器、监听器等配置。其中,`mime-mapping`...

Global site tag (gtag.js) - Google Analytics