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

查看:13
本文介绍了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.

推荐答案

为扩展名为 * 类型为 application/octet-stream 的文件添加新的 MIME 类型.这将为所有没有 MIME 类型的文件提供默认 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天全站免登陆