【问题标题】:Maximum request length exceeded when uploading file to IIS 8将文件上传到 IIS 8 时超出最大请求长度
【发布时间】:2019-08-08 04:46:30
【问题描述】:

我得到:异常详细信息:System.Web.HttpException:超出最大请求长度。我正在使用 Windows 2012 IIS。我检查了 IIS 中的设置,它设置为 30000000。我上传的文件是 20mb。我尝试将下面的代码添加到 web.config 文件中。我已经上传了较小的文件,没有任何问题。还有其他想法吗?

<system.webServer>

   <security>

      <requestFiltering>

         <requestLimits maxAllowedContentLength="3000000000" />

      </requestFiltering>

   </security>

</system.webServer>

【问题讨论】:

    标签: asp.net-mvc iis-8


    【解决方案1】:

    尝试像这样设置 maxRequestLength:

    <configuration>
      <system.web>
        <httpRuntime maxRequestLength="500000" />
      </system.web>
    </configuration>
    

    maxRequestLength 表示 ASP.NET 支持的最大文件上传大小。指定的大小以千字节为单位。默认值为 4096 KB (4 MB)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-22
      • 2016-07-07
      • 1970-01-01
      相关资源
      最近更新 更多