IIS 设置文件可下载

IIS 设置文件可下载

IIS遇到了文件不能下载的问题.为了让IIS能下载扩展名是INI的文件,我们需要如此操作:(括号内的是英文版本的名字)

打开“IIS管理器(InternetInformationServices(IIS)Manager)”

选择到你的站点。单击右键。选择“属性(Properties)”

单击“HTTP头(HTTPHeaders)”选项卡

单击“MIME类型(MIMETypes)”

单击“新建(NEW)”

在“扩展名(Extension)”框中,输入文件扩展名,这里是ini

在“MIME类型(MIMETypes)”框中,输入该扩展名的说明。这里输入的是application/octet-stream

解释一下:

MIMETypes中输入application/octet-stream的目的是为了让IIS把INI文件当作是EXE那样,出现下载的提示。

否则的话是出现404的提示或是直接在浏览器中把内容给显示出来了。都不能达到我们的目的。

 

 

=================

另附mime的所有类型

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



回复列表



回复操作

正在加载验证码......

请先拖动验证码到相应位置

发布时间:2016-08-04 13:58:31

修改时间:2016-08-04 13:58:31

查看次数:348

评论次数:0

TA的文章总数

49