当我尝试上传大文件(超过10MB)时,我的页面向我显示:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
我的web.config有这个
<httpRuntime requestValidationMode="2.0" maxRequestLength="15000" />
和<customErrors mode="RemoteOnly" defaultRedirect="~/Errorhandling.aspx">
<error statusCode="404" redirect="~/NotFound.html" />
<error statusCode="413" redirect="~/TooBig.html" />
</customErrors>
为什么不将我重定向到TooBig.html而不显示上述消息?笔记
默认的ASP.NET允许为4MB,这就是为什么我将
maxRequestLength
更改为15000的原因。(此时将其更改为150000并没有什么区别,因为我最多只能测试10MB)
最佳答案
在使用不同大小的文件迁移到IIS7时遇到了这个问题。但是下面的解决方案当时对我有用。您应该将这些部分添加到您的webconfig或appconfig文件中,具体取决于所需的范围。
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000"/>
</requestFiltering>
</security>
</system.webServer>
有关更多信息,请参见。
http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits
关于asp.net - 找不到资源,而不是超过413个请求长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15413566/