iis7默认的mime类型行为 [英] iis7 default mime type behavior

查看:177
本文介绍了iis7默认的mime类型行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,在IIS 7中,如果某个扩展名没有特定的MIME定义,即使您可以在目录列表中看到它,它也将拒绝提供它(404)。我确定这是一个相当已知的问题,但有没有办法通配符或为未知文件类型设置默认操作?我希望默认下载所有内容,就像我使用过的每个其他网络服务器一样。

So in IIS 7 if there is no specific MIME definition for a certain extension, it will refuse to serve it (404) even if you can see it in a directory listing. I'm sure this is a fairly known issue, but is there a way to wildcard or set a default action for unknown file types? I want everything to be offered for download by default like with every other webserver I've used.

推荐答案

添加新的MIME类型对于扩展名为 * 的文件,类型为 application / octet-stream 。这将为没有一个文件的所有文件提供默认的MIME类型,并绕过阻止。

Add a new MIME type for files of extension * with a type of application/octet-stream. This will provide a default MIME type for all files that don't have one and bypass the blocking.

然而,风险是您最终共享机密数据库,配置文件等等,因此在向所有人打开服务器之前,请确保知道自己在做什么下载。

The risk, however, is you end up sharing your confidential database, configuration files and whatnot, so make sure you know what you are doing before you open your server to all downloads.

这篇关于iis7默认的mime类型行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆