System.Web.HttpException: Maximum request length exceeded

.net程序在上传一个8M多的文件的时候报错

错误原因:

由于web.config中设置的asp.net最大支持的请求小于您所上传的文件大小,默认支持4M的。

修改方法:

web.Config中
<httpRuntime   requestLengthDiskThreshold   = "10240 "
maxRequestLength   = "10240 "   />

如果不起作用,则需要修改IIS默认配置

C:\WINDOWS\system32\inetsrv\metabase.xml
找到   这个   AspMaxRequestEntityAllowed= "204800 "   改成你需要的大小

不过,首先要把   IIS   Admin   Service   这个服务停止,才能修改
修改后,在将该服务启动

时间: 2024-08-14 09:26:43

System.Web.HttpException: Maximum request length exceeded的相关文章

asp.net 文件上传出错:Maximum request length exceeded 解决方法

<configuration>    <system.web>               <httpRuntime maxRequestLength="102400" useFullyQualifiedRedirectUrl="true" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="10

IIS: 配置web.config解决Maximum request length exceeded错误

In system.web <httpRuntime maxRequestLength="1048576" executionTimeout="3600" /> And in system.webServer <security> <requestFiltering> <requestLimits maxAllowedContentLength="1073741824" /> </reques

异常System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent.

在用mvc 的AuthorizeAttribute做身份验证,重写HandleUnauthorizedRequest方法,在Application_Error方法里出现异常System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent. 反复尝试发现是在 protected override void HandleUnauthorizedRequest(Author

System.Web.HttpPostFile.cs

ylbtech-System.Web.HttpPostFile.cs 1.返回顶部 1. #region 程序集 System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a // C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll #endregion usi

System.Web.HttpRequest.cs

ylbtech-System.Web.HttpRequest.cs 1.返回顶部 1. #region 程序集 System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a // C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll #endregion usin

arcgis server &quot;System.Web.Services.Protocols.SoapException: Error processing server request&quot;.

在 Arcgis Server 10中创建第一个程序,运行的时候就报错:System.Web.Services.Protocols.SoapException: Error processing server request 详细信息: Server Error in '/' Application. Error processing server request Description: An unhandled exception occurred during the execution

System.Web.HttpRequestValidationException: 从客户端(dbFlag=&amp;quot;&amp;lt;soap:Envelope xmlns...&amp;quot;)中检测到有潜在危险的 Request.Form 值。

System.Web.HttpRequestValidationException: 从客户端(dbFlag="<soap:Envelope xmlns...")中检测到有潜在危险的 Request.Form 值. 在 System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) 在 System.Web.Ht

ASP.NET 4.0验证请求 System.Web.HttpRequestValidationException: A potentially dangerous Request.F

System.Web.HttpRequestValidationException: A potentially dangerous Request.F 在使用类似eWebedtior 拷贝内容进去的时候会带入 <> 在保存的时候会失败 解决方法如下: 当页面输入框默认情况下输入“<”或者“>”的时候.按照访问策略,这将导致一些安全问题,诸如:跨站脚本攻击(cross-site scripting attack).而这个问题的更准确描述则是,当你在安装了.NET Framework

从System.Web.Http.Owin的HttpMessageHandlerAdapter看适配器模式

.mytitle { background: #2B6695; color: white; font-family: "微软雅黑", "宋体", "黑体", Arial; font-size: 18px; font-weight: bold; height: 25px; line-height: 25px; margin: 15px 0 !important; padding: 5px 0 5px 20px; width: 97% } .arti