2016-11-15 35 views
0

我想上传大小超过5MB的文件,但是我在设置错误 “超过了最大请求长度”。在ASP.net中上传大文件IIS 7或更高版本

我已经在

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

不过我有错误web.config文件中下面的代码。

+0

尝试加入这个'maxRequestLength'为好。我认为你需要'maxRequestLength'和'maxAllowedContentLength'才能使它工作。 – Nitin

回答

0

试试这个: -

在你的web.config文件中,补充一点: -

<system.web> 
<httpRuntime maxRequestLength="3145728" /> <!--3145728KB=3072MB=3GB--> 
</system.web> 

然后

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