网站不允许大文件上传

时间:2012-04-23 14:08:01

标签: asp.net iis iis-7

我有一个在IIS 6上运行的ASP.NET网站,效果很好。我们允许客户上传大文件(50MB +),没有任何问题。我们最近移动了(我的公司),我们的网站也被移到了异地(在他们在我们自己的建筑物的服务器上之前),我们不得不从IIS 6切换到IIS 7.自从采取行动,我们的网站赢了不允许我们的客户传输大文件。我测试了较小的文件(< 10MB)并且上传很好,但是当我尝试超过10MB的时候,我得到404错误:

404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

我们的web.config中已经有以下内容:

<httpRuntime maxRequestLength="1321600" />

我缺少IIS 7中的设置吗?

2 个答案:

答案 0 :(得分:8)

您应该可以从web.config更改此设置:

<system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="524288000"/>
            </requestFiltering>
        </security>
</system.webServer>

此处有更多信息:http://support.microsoft.com/kb/942074/

答案 1 :(得分:0)

上传限制存储在machine.config。

您可以在web.config中覆盖它,如下所示:

<system.web>
        <httpRuntime executionTimeout="110" maxRequestLength="20000" />
</system.web>

您可以在this MSDN document找到更多相关信息。