【发布时间】:2012-10-30 18:32:32
【问题描述】:
我有一个类似的问题:How to set the maxAllowedContentLength to 500MB while running on IIS7?
不同之处在于我已经修改了我的web.config 以接受最大为 2 Gb 的文件,但是当尝试上传大文件时,我收到以下错误:
请求过滤模块被配置为拒绝超过内容长度的请求。
我的web.config 是这样的:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2097151"/>
<customErrors mode="Off"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<membership>
<providers>
<clear/>
</providers>
</membership>
<profile>
<providers>
<clear/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
</providers>
</roleManager>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2097151" />
</requestFiltering>
</security>
</system.webServer>
当我尝试上传只有131 MB 的文件时,我仍然收到错误消息。
那么,我应该在maxAllowedContentLength 设置中设置什么以允许人们上传超过 100 MB 的文件?
【问题讨论】: