当我尝试在我的网站上载视频时,我收到错误消息超出最大请求长度。
我该如何解决这个问题?
最佳答案
如果您使用 IIS 托管您的应用程序,则默认上传文件大小为 4MB。要增加它,请在 web.config
-
<configuration>
<system.web>
<httpRuntime maxRequestLength="1048576" />
</system.web>
</configuration>
对于IIS7及以上版本,还需要添加以下行:
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
注意:
maxRequestLength
以千字节 为单位
maxAllowedContentLength
以字节 衡量
这就是此配置示例中值不同的原因。 (两者都相当于 1 GB。)
关于asp.net - 超出最大请求长度。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19327949/