【问题标题】:maxAllowedContentLength ignored忽略 maxAllowedContentLength
【发布时间】:2018-02-20 05:45:25
【问题描述】:

我的网络配置中有以下设置:

<system.web>
    <compilation debug="true" strict="false" explicit="true"     targetFramework="4.6" />
    <httpRuntime requestValidationMode="2.0" targetFramework="4.6" maxRequestLength="92160" executionTimeout="3600" />
  </system.web>

 <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="94371840" />
     </requestFiltering>
  </security>

它们都等于 90 MB。我正在使用 Telerik 的异步上传器来上传文件。我一直在通过上传 100 MB 的文件进行测试,以查看是否触发了错误。但是,文件上传没有问题。无法弄清楚为什么没有触发错误。这个问题可能就在我面前。谁能弄清楚为什么?

【问题讨论】:

    标签: c# asp.net iis iis-7 telerik


    【解决方案1】:

    system.web

    <httpRuntime maxRequestLength="90000" executionTimeout="3600" />
    

    在 system.webServer 中

    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="90000000" />
        </requestFiltering>
    </security>
    

    重要提示:这两个值都必须匹配,并且 maxRequestLengthKiloBytes 中测量,其中 maxallowedContentLengthBytes 中,因此两个值都设置为 90mb

    来自 IIS7

    或者在 IIS (7) 中:

    选择您要启用以接受大文件上传的网站。在 主窗口双击“请求过滤”选择“编辑功能 设置”修改“最大允许内容长度(字节)”

    【讨论】:

    • 我将您的值完全复制到 webconfig 中。我仍然能够上传 100 MB 的文件。
    • @pmb88 应该是,您是否进行了干净的构建并重新运行它?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-16
    相关资源
    最近更新 更多