使用Asp.Net上传视频等大文件时,需要配置项目web.config文件(Asp.Net默认上传限制为4M):
1.asp.net程序请求运行最大长度
<system.web>
<!--设置上传文件大小 maxRequestLength单位为kb最大不能超过2g,executionTimeout单位为s-->
<httpRuntime targetFramework="4.5" maxRequestLength="307200" executionTimeout="3600"/>
</system.web>
2.服务器端允许最大长度,一般服务器默认为30m
<system.webServer>
<security>
<requestFiltering>
<!--设置上传文件大小 maxRequestLength单位为kb最大不能超过2g,executionTimeout单位为s-->
<requestLimits maxAllowedContentLength="1073741824"/>
</requestFiltering>
</security>
</system.webServer>