我正在构建一个MVC5应用程序,用户可以上传图像。我碰到了4mb的文件大小上限。我能读到的解决方案是将以下内容添加到web.config:
<system.web>
<httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>但这样做时,站点会崩溃,并出现配置错误:
无法访问请求的页面,因为该页面的相关配置数据无效。
删除行,该站点将再次运行。
是否有其他选择或变通办法?
发布于 2016-09-10 09:40:33
对于IIS7或更高版本,请将此行添加到webconfig
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800" /> <!--50MB-->
</requestFiltering>
</security>
</system.webServer>或打开IIS GUI

https://stackoverflow.com/questions/39421110
复制相似问题