我有一个类似的问题: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 的文件?