php文件类型MIME对照表(比较全)

由于内容过多,大家可以通过ctrl+F搜索即可

IE浏览器
id 后缀名 php识别出的文件类型
0 gif image/gif
1 jpg image/jpeg
2 png image/png
3 bmp image/bmp
4 psd application/octet-stream
5 ico image/x-icon
6 rar application/octet-stream
7 zip application/zip
8 7z application/octet-stream
9 exe application/octet-stream
10 avi video/avi
11 rmvb application/vnd.rn-realmedia-vbr
12 3gp application/octet-stream
13 flv application/octet-stream
14 mp3 audio/mpeg
15 wav audio/wav
16 krc application/octet-stream
17 lrc application/octet-stream
18 txt text/plain
19 doc application/msword
20 xls application/vnd.ms-excel
21 ppt application/vnd.ms-powerpoint
22 pdf application/pdf
23 chm application/octet-stream
24 mdb application/msaccess
25 sql application/octet-stream
26 con application/octet-stream
27 log text/plain
28 dat application/octet-stream
29 ini application/octet-stream
30 php application/octet-stream
31 html text/html
32 htm text/html
33 ttf application/octet-stream
34 fon application/octet-stream
35 js application/x-javascript
36 xml text/xml
37 dll application/octet-stream
38 dll application/octet-stream

火狐
id 后缀名 php识别出的文件类型
0 gif image/gif
1 jpg image/pjpeg
2 png image/x-png
3 bmp image/bmp
4 psd application/octet-stream
5 ico image/x-icon
6 rar application/octet-stream
7 zip application/x-zip-compressed
8 7z application/octet-stream
9 exe application/octet-stream
10 avi video/avi
11 rmvb application/vnd.rn-realmedia-vbr
12 3gp application/octet-stream
13 flv application/octet-stream
14 mp3 audio/mpeg
15 wav audio/wav
16 krc application/octet-stream
17 lrc application/octet-stream
18 txt text/plain
19 doc application/msword
20 xls application/vnd.ms-excel
21 ppt application/vnd.ms-powerpoint
22 pdf application/pdf
23 chm application/octet-stream
24 mdb application/msaccess
25 sql text/plain
26 con application/octet-stream
27 log text/plain
28 dat text/plain
29 ini application/octet-stream
30 php application/octet-stream
31 html text/html
32 htm text/html
33 ttf application/octet-stream
34 fon application/octet-stream
35 js text/html
36 xml text/xml
37 dll application/octet-stream
38 class application/java
------------------------------
ie和火狐一样
* 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
jpg image/pjpeg
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
png image/x-png
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
sv4cpio application/x-sv4cpio
sv4crc application/x-sv4crc
t application/x-troff
tar application/x-tar
tcl application/x-tcl
tex application/x-tex
texi application/x-texinfo
texinfo application/x-texinfo
tgz application/x-compressed
tif image/tiff
tiff image/tiff
tr application/x-troff
trm application/x-msterminal
tsv text/tab-separated-values
txt text/plain
uls text/iuls
ustar application/x-ustar
vcf text/x-vcard
vrml x-world/x-vrml
wav audio/x-wav
wcm application/vnd.ms-works
wdb application/vnd.ms-works
wks application/vnd.ms-works
wmf application/x-msmetafile
wps application/vnd.ms-works
wri application/x-mswrite
wrl x-world/x-vrml
wrz x-world/x-vrml
xaf x-world/x-vrml
xbm image/x-xbitmap
xla application/vnd.ms-excel
xlc application/vnd.ms-excel
xlm application/vnd.ms-excel
xls application/vnd.ms-excel
xlt application/vnd.ms-excel
xlw application/vnd.ms-excel
xof x-world/x-vrml
xpm image/x-xpixmap
xwd image/x-xwindowdump
z application/x-compress
zip application/zip -firefox
application/x-zip-compressed -IE
php上传压缩文件(rar,7z,zip)
php上传可执行文件(exe)
php上传视频文件,音乐文件,歌词文件(avi,rmvb,3gp,flv,mp3,wav,krc,lrc)
php上传文本文件和文档文件(word->doc,excel->xls,幻灯片->ppt,pdf,chm)
php上传数据库文件(access文件,sql文件,con文件,日志文件log, dat文件)
php上传网页文件,脚本文件,字体文件(ini,php,html,htm,字体文件:ttf,fon, js ,xml)
php上传其他文件(class类文件,dll动态加载库文件)
php文件类型对照表!很方便看出文件是什么类型。如gif是image/gif类型

以下是其它网友的补充:

'acx' => 'application/internet-property-stream',
'ai' => 'application/postscript',
'aif' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'asp' => 'text/plain',
'aspx' => 'text/plain',
'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',
'flv' => 'video/x-flv',
'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',
'php' => 'text/plain',
'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',
'png' => 'image/png',
'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',
'wmv' => 'video/x-ms-wmv',
'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',

(0)

相关推荐

  • http图片上传安全性问题 根据ContentType (MIME) 判断其实不准确、不安全

    图片上传常用的类型判断方法有这么几种---截取扩展名.获取文件ContentType (MIME) .读取byte来判断(这个什么叫法来着?).前两种都有安全问题.容易被上传不安全的文件,如木马什么的.第1种截取文件扩展名来判断的方法很明显不安 全,第2种ContentType MIME可以伪造,所以用ContentType来判断其实也不安全.建议采用第3种. C#演示: 1.截取扩展名来做判断,不可取. if (Request.Files.Count > 0) { //这里只测试上传第一张图片

  • IIS解析json的配置方法汇总

    IIS6.0 1.打开IIS添加Mime项 关联扩展名: *.json 内容类型(MIME):application/x-JavaScript 2.添加映射: 位置在IIS对应站点右键属性:"主目录"-"应用程序设置"-"配置"-"映射"-"添加",会打开"添加/编辑应用程序扩展名映射" 扩展名: .json 运行文件:C:\WINDOWS\system32\inetsrv\asp.dl

  • IIS自定义MIME类型的步骤

    单击[开始]→[程序]→[管理工具]→[IIS管理器],逐步展开"本地计算机"."网站",在你的网站上右击,选择[属性],单击"HTTP头"选项卡→单击"MIME类型"按钮,再单击"新建"按钮,在"扩展名"框内输入".flv","MIME类型"框中输入"flv-application/octet-stream",然后确定即可.&

  • Mime类型与文件后缀对照表

    方便iis中或其他服务器对相应的文件进行解析 有一些格式上传后无法下载或访问,需要设置MIME, 在主机管理>管理>设置MIME,里添加,比如.flv就需要设置后才能访问 文件后缀 MIME 备注 *.avi video/x-msvideo 视频文件 *.aif *.aiff *.aifc audio/x-aiff 声音文件 *.au *.snd audio/basic 声音文件 *.ai *.eps *.ps application/postscript   *.asd *.asn appl

  • 下载站mime属性设置(让文件可下载)

    一般软件下载 .torrentapplication/octet-stream .7zapplication/octet-stream .isoapplication/octet-stream 手机相关类型: .apkapplication/vnd.android.package-archive .dedapplication/vnd.iphone .dmg application/octet-stream .ipaapplication/vnd.iphone .app application/

  • Win2003 手机站IIS MIME类型设置大全

    详细步骤为: 打开Internet 服务管理器Internet 服务管理器-->网站属性-->HTTP头(MIME映射)-->新建 添加内容类型(MIME) 关联扩展名 下面是常用的手机文件格式扩展名: 如果需要对支持java下载:在iis中需要添加 .jad-->text/vnd.sun.j2me.app-de .jar-->application/java-archive 诺基亚塞班手机s60v5.s60v3支持sis文件下载:在iis中需要添加 .sis applica

  • MIME类型大全(response.setContentType中MIME参数类型总结)

    MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问的时候,浏览器会自动使用指定应用程序来打开.多用于指定一些客户端自定义的文件名,以及一些媒体文件打开方式. 如果服务器没有对应的设置,很多文件无法通过web服务器解析,造成无法下载无法播放的问题. 下面列出常用的文件对应的MIME类型: Mime-Types(mime类型) Dateiendung(扩展名) Bedeutung application/msexcel *.xls *.xla Microsoft

  • php文件类型MIME对照表(比较全)

    由于内容过多,大家可以通过ctrl+F搜索即可 IE浏览器 id 后缀名 php识别出的文件类型 0 gif image/gif 1 jpg image/jpeg 2 png image/png 3 bmp image/bmp 4 psd application/octet-stream 5 ico image/x-icon 6 rar application/octet-stream 7 zip application/zip 8 7z application/octet-stream 9 e

  • php 文件上传后缀名与文件类型对照表(几乎涵盖所有文件)

    网上有很多php文件上传的类,文件上传处理是php的一个特色(至少手册上是将此作为php特点来展示的,个人认为php在数组方面的优异功能更有特色),学php的人都知道文件上传怎么做,但很多人在编程中却可能忽视了一些细节问题,那就是文件的类型(MIME).在表单将文件提交给php做处理之前,浏览器会先解析识别一边是什么类型的文件,之后进入php处理环节,php又会去识别解析此文件的原始类型(并不是说你改成什么后缀就是什么文件).在这个过程中会有一些浏览器兼容,更准确来说是文件类型解析标识不一致的问

  • PHP文件上传后缀名与文件类型对照表整理

    ie 火狐 id 后缀名 php识别出的文件类型 0 gif image/gif 1 jpg image/jpeg 2 png image/png 3 bmp image/bmp 4 psd application/octet-stream 5 ico image/x-icon 6 rar application/octet-stream 7 zip application/zip 8 7z application/octet-stream 9 exe application/octet-str

  • php获取文件类型和文件信息的方法

    本文实例讲述了php获取文件类型和文件信息的方法.分享给大家供大家参考.具体实现方法如下: <?php $file = "php.txt"; //打开文件,r表示以只读方式打开 $handle = fopen($file,"r"); //获取文件的统计信息 $fstat = fstat($handle); echo "文件名:".basename($file)."<br>"; //echo "文件大

  • PHP 文件类型判断代码

    何为MIME类型,它是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问时,浏览器会自动使用指定应用程序来打开. 多用于指定一些客户端自定义的文件名,以及一些媒体文件打开方式. 参考链接:php文件格式(mime类型)对照表 . 1.mime_content_type()函数判断获取mime类型 mime_content_type返回指定文件的MIME类型,用法: echo mime_content_type ( 'php.gif' ) . "\n" ; echo

  • Python使用filetype精确判断文件类型

    filetype.py Small and dependency free Python package to infer file type and MIME type checking the  magic numbers signature of a file or buffer. This is a Python port from filetype Go package. Works in Python  +3 . 一个小巧自由开放Python开发包,主要用来获得文件类型.包要求Pyt

  • ASP.net判断上传文件类型的三种有效方法

    一.安全性比较低,把文本文件1.txt改成1.jpg照样可以上传,但其实现方法容易理解,实现也简单,所以网上很多还是采取这种方法. 复制代码 代码如下: Boolean fileOk = false; string path = Server.MapPath("~/images/"); //判断是否已经选取文件 if (FileUpload1.HasFile) { //取得文件的扩展名,并转换成小写 string fileExtension = System.IO.Path.GetEx

  • 利用PHP实现智能文件类型检测的实现代码

    使用文件后缀和MIME类型检测 通常我们想严格限制文件类型的时候,可以简单地用$_FILES['myFile']['type'] 取得文件的 MIME类型然后来检测它是否是合法的类型. 或者我们可以取文件名的最后几个字符来获取文件后缀,不幸的是,这些方法并不足够,可以很容易地改变文件的扩展名绕过这个限制.此外,MIME类型信息是由浏览器发送的,而且,对于大多数浏览器,即使不是全部,是根据文件的扩展名的来给出MIME类型信息的!因此,MIME类型,就像扩展名一样,可以很容易地欺骗. 使用"魔术字节

  • node.js解决获取图片真实文件类型的问题

    遇到一个需求:假定有一个图片文件,真实的类型为jpg,而有人偷懒把jpg直接复制一张,存为同名的png文件,这样在as3读取文件时不会遇到问题,但手机c++在读取文件时却遇到问题了 - -! 现在就需要写一个程序,遍历所有文件夹下的文件,查找文件格式"不正常"的文件.我们的资源主要是gif.png.jpg,最开始,我到网上找到一篇文章:根据二进制流及文件头获取文件类型mime-type,然后读取文件二进制的头信息,获取其真实的文件类型,对与通过后缀名获得的文件类型进行比较. 复制代码

  • 在IIS6中新增可下载文件类型的方法

    使用 MIME 类型 Multipurpose Internet Mail Exchange (MIME) 类型说明了 Web 浏览器或邮件应用程序如何处理从服务器接收的文件.例如,当 Web 浏览器请求服务器上的某一项目时,也会请求此对象的 MIME 类型.某些 MIME 类型(例如图形)可以在浏览器内部显示.其他的 MIME 类型(例如文字处理文档)则需要使用外部帮助应用程序来显示. 当 IIS 传递邮件消息给邮件应用程序或传递网页给客户端 Web 浏览器时,IIS 也发送了所传递数据的 M

随机推荐