当上载文件超过4 MB时出现错误超过了最大请求长度. [英] When Upload file more than 4 MB gives error Maximum request length exceeded.

查看:196
本文介绍了当上载文件超过4 MB时出现错误超过了最大请求长度.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在web.config中,我已经完成了maxRequestLength ="10240"和maxAllowedContentLength ="10485760"和参数< add key ="DocUploadValidationSize" value ="10485760">的配置.但是当上传文件最大4 MB时,它将给出错误.任何人都试图上传超过10个或以上的文件(如果有什么设置?).

In web.config i have done configuration maxRequestLength="10240" and maxAllowedContentLength="10485760" and parameter <add key="DocUploadValidationSize" value="10485760"> but when upload file upto 4 MB it will give error. any one tried to upload file more than 10 or above if what are the settings?.

推荐答案

Setting up Web.config to allow uploading of large files by ASP .NET applications[^]



To prevent canceling script execution when uploading a large file to application hosted in IIS / ASP.NET you must increase script timeout value:
HttpContext.Current.Server.ScriptTimeout = 2400; // timeout in seconds


添加此Web.Config文件中System.Web中的标记:-
Add this tag in System.Web in Web.Config file:-
<httpruntime executiontimeout="3600" maxrequestlength="102400" requestlengthdiskthreshold="80" usefullyqualifiedredirecturl="false" minfreethreads="8" minlocalrequestfreethreads="4" apprequestqueuelimit="5000" enablekerneloutputcache="true" enableversionheader="true" requirerootedsaveaspath="true" enable="true" shutdowntimeout="90" delaynotificationtimeout="5" waitchangenotification="0" maxwaitchangenotification="0" enableheaderchecking="true" sendcachecontrolheader="true" apartmentthreading="false" />



祝你好运.



Good luck.


<httpruntime  executionTimeout="9999"  maxRequestLength="8192"  />




在这里,我给了8 Mb作为最大限制.对于16gb 16384,很快.

请记住,您还必须增加执行超时..只需几秒钟.




Here i gave 8 Mb as max limit. For 16gb 16384, soon.

Remember you also have to increase your executiontimeout.. It will be in seconds.


这篇关于当上载文件超过4 MB时出现错误超过了最大请求长度.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆