目前,如果我托管一个 Access .MDB 文件以允许用户下载,IIS7 将抛出 404 错误。我知道文件在那里并且权限很好。这似乎是一个处理程序问题,但我无法弄清楚如何更改处理程序以允许下载 MDB 文件。我假设我需要向 web.config 的 Handlers 部分添加一些内容,但我不确定语法。
谢谢。
最佳答案
或者,如果您不想修改系统范围的配置文件,您可以将以下行添加到 web.config 中的该部分:
<remove fileExtension=".mdb" />
<add fileExtension=".mdb" allowed="true"/>
例如,您的 Web.config 应该类似于:
<configuration>
<system.webServer>
<security>
<requestFiltering>
<fileExtensions allowUnlisted="true" >
<remove fileExtension=".mdb" />
<add fileExtension=".mdb" allowed="true"/>
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
</configuration>
另见 http://www.adamwlewis.com/articles/iis-7-not-serving-files-4047-error .
关于ms-access - 允许在 IIS7 中下载 MDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2066981/