我有一个表单,除了ASP.NET中的文件上传。我需要增加最大上传大小,以超过4MB的默认值。
我发现在某些地方引用了msdn上的以下代码。
[ConfigurationPropertyAttribute("maxRequestLength", DefaultValue = )]
没有一个参考文献实际描述了如何使用它,我已经尝试了几种方法,但都没有成功。我只想修改此属性的某些页面,是要求文件上传。
这是正确的路线吗?我该如何使用它呢?
发布于 2008-11-13 22:56:56
此设置位于您的web.config文件中。不过,它会影响整个应用程序。我不认为你可以将它设置为每页。
<configuration>
<system.web>
<httpRuntime maxRequestLength="xxx" />
</system.web>
</configuration>
"xxx“以KB为单位。默认值为4096 (= 4 MB)。
发布于 2008-11-13 22:56:08
我相信Web.config
中的这一行将设置最大上传大小:
<system.web>
<httpRuntime maxRequestLength="600000"/>
</system.web>
发布于 2015-09-11 17:14:40
对于2 GB的最大限制,请在应用程序web.config上执行以下操作:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="1600" requestLengthDiskThreshold="2147483647" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
https://stackoverflow.com/questions/288612
复制相似问题