上传文件的时候报长度超过限制长度


Server Error in '/' Application.


Maximum request length exceeded.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Maximum request length exceeded.


错误原因:这个错误的引起是因为应用程序最大请求字节长度超过了默认请求字节长度

解决方案:可以在Web.Config添加如下配置:

<system.web>下面加上下面一句.搞定.
  <httpRuntime executionTimeout="300" maxRequestLength="51200"/>

或加如下一段也可解决.

  <httpRuntime
   executionTimeout="1200"
   maxRequestLength="102400"
   useFullyQualifiedRedirectUrl="false"
   minFreeThreads="8"
   minLocalRequestFreeThreads="4"
   appRequestQueueLimit="100"

   />


原文地址:https://www.cnblogs.com/superMay/p/5044954.html