解决IIS播放flv、mp4时404错误

最近搭了一台IIS的服务器,以前都是用apache的,很少接触IIS。刚开始用着没什么问题,但后来开发反映无法播放视频。

跑过去看了一下,只要是后缀是.mp4和.flv的视频,访问时一律报404。很奇怪,以前用apache时从来没遇到过。

随后百度了一下。发现是IIS设置的问题。

在网站的属性---http头---MIME类型中加上对应的值就可以了。

具体的对应值如下:

Mime Types

If you are creating a podcast or video feed you will need to include the appropriate mime type, the proper format is indicated below.

file typeMIME type
aiapplication/postscript
aifaudio/x-aiff
aifcaudio/x-aiff
aiffaudio/x-aiff
asctext/plain
atomapplication/atom+xml
auaudio/basic
avivideo/x-msvideo
bcpioapplication/x-bcpio
binapplication/octet-stream
bmpimage/bmp
cdfapplication/x-netcdf
cgmimage/cgm
classapplication/octet-stream
cpioapplication/x-cpio
cptapplication/mac-compactpro
cshapplication/x-csh
csstext/css
dcrapplication/x-director
difvideo/x-dv
dirapplication/x-director
djvimage/vnd.djvu
djvuimage/vnd.djvu
dllapplication/octet-stream
dmgapplication/octet-stream
dmsapplication/octet-stream
docapplication/msword
dtdapplication/xml-dtd
dvvideo/x-dv
dviapplication/x-dvi
dxrapplication/x-director
epsapplication/postscript
etxtext/x-setext
exeapplication/octet-stream
ezapplication/andrew-inset
gifimage/gif
gramapplication/srgs
grxmlapplication/srgs+xml
gtarapplication/x-gtar
hdfapplication/x-hdf
hqxapplication/mac-binhex40
htmtext/html
htmltext/html
icex-conference/x-cooltalk
icoimage/x-icon
icstext/calendar
iefimage/ief
ifbtext/calendar
igesmodel/iges
igsmodel/iges
jnlpapplication/x-java-jnlp-file
jp2image/jp2
jpeimage/jpeg
jpegimage/jpeg
jpgimage/jpeg
jsapplication/x-javascript
karaudio/midi
latexapplication/x-latex
lhaapplication/octet-stream
lzhapplication/octet-stream
m3uaudio/x-mpegurl
m4aaudio/mp4a-latm
m4baudio/mp4a-latm
m4paudio/mp4a-latm
m4uvideo/vnd.mpegurl
m4vvideo/x-m4v
macimage/x-macpaint
manapplication/x-troff-man
mathmlapplication/mathml+xml
meapplication/x-troff-me
meshmodel/mesh
midaudio/midi
midiaudio/midi
mifapplication/vnd.mif
movvideo/quicktime
movievideo/x-sgi-movie
mp2audio/mpeg
mp3audio/mpeg
mp4video/mp4
mpevideo/mpeg
mpegvideo/mpeg
mpgvideo/mpeg
mpgaaudio/mpeg
msapplication/x-troff-ms
mshmodel/mesh
mxuvideo/vnd.mpegurl
ncapplication/x-netcdf
odaapplication/oda
oggapplication/ogg
pbmimage/x-portable-bitmap
pctimage/pict
pdbchemical/x-pdb
pdfapplication/pdf
pgmimage/x-portable-graymap
pgnapplication/x-chess-pgn
picimage/pict
pictimage/pict
pngimage/png
pnmimage/x-portable-anymap
pntimage/x-macpaint
pntgimage/x-macpaint
ppmimage/x-portable-pixmap
pptapplication/vnd.ms-powerpoint
psapplication/postscript
qtvideo/quicktime
qtiimage/x-quicktime
qtifimage/x-quicktime
raaudio/x-pn-realaudio
ramaudio/x-pn-realaudio
rasimage/x-cmu-raster
rdfapplication/rdf+xml
rgbimage/x-rgb
rmapplication/vnd.rn-realmedia
roffapplication/x-troff
rtftext/rtf
rtxtext/richtext
sgmtext/sgml
sgmltext/sgml
shapplication/x-sh
sharapplication/x-shar
silomodel/mesh
sitapplication/x-stuffit
skdapplication/x-koan
skmapplication/x-koan
skpapplication/x-koan
sktapplication/x-koan
smiapplication/smil
smilapplication/smil
sndaudio/basic
soapplication/octet-stream
splapplication/x-futuresplash
srcapplication/x-wais-source
sv4cpioapplication/x-sv4cpio
sv4crcapplication/x-sv4crc
svgimage/svg+xml
swfapplication/x-shockwave-flash
tapplication/x-troff
tarapplication/x-tar
tclapplication/x-tcl
texapplication/x-tex
texiapplication/x-texinfo
texinfoapplication/x-texinfo
tifimage/tiff
tiffimage/tiff
trapplication/x-troff
tsvtext/tab-separated-values
txttext/plain
ustarapplication/x-ustar
vcdapplication/x-cdlink
vrmlmodel/vrml
vxmlapplication/voicexml+xml
wavaudio/x-wav
wbmpimage/vnd.wap.wbmp
wbmxlapplication/vnd.wap.wbxml
wmltext/vnd.wap.wml
wmlcapplication/vnd.wap.wmlc
wmlstext/vnd.wap.wmlscript
wmlscapplication/vnd.wap.wmlscriptc
wrlmodel/vrml
xbmimage/x-xbitmap
xhtapplication/xhtml+xml
xhtmlapplication/xhtml+xml
xlsapplication/vnd.ms-excel
xmlapplication/xml
xpmimage/x-xpixmap
xslapplication/xml
xsltapplication/xslt+xml
xulapplication/vnd.mozilla.xul+xml
xwdimage/x-xwindowdump
xyzchemical/x-xyz
zipapplication/zip

参考自:http://www.feedforall.com/mime-types.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值