在Asp.net中使用FileUpload上传文件,对于小文件一般是没有问题的,但是对于大的文件则会出问题。提示“未显示页面,因为请求实体过大”,网上找了资料,按照所说的方法来处理,都未能解决该问题。
在web.config中的configuration/system.web节点中已经作了如下配置,但依旧异常。
<httpRuntime targetFramework="4.5" executionTimeout="5000" maxRequestLength="409600000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />
后来按提示又增加了如下配置(在configuration/system.webServer节点下)
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="4096000000">
</requestLimits>
</requestFiltering>
</security>
再次运行后就正常了。