解决C# MVC上传文件过大导致的报错

提示错误:Web 服务器上的请求筛选被配置为拒绝该请求,因为内容长度超过配置的值。

在<configuration>节点下配置以下内容:

  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483647"/>
      </requestFiltering>
    </security>
  </system.webServer>

在httpRuntime新增maxRequestLength="2147483647"

  <system.web>
    <compilation debug="true" targetFramework="4.7.2" />
    <httpRuntime maxRequestLength="2147483647"  targetFramework="4.7.2" />
  </system.web>

配置完以上内容就可以了

版权声明:
作者:清风
链接:https://www.newadmin.cn/archives/1408
来源:NA博客
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
海报
解决C# MVC上传文件过大导致的报错
提示错误:Web 服务器上的请求筛选被配置为拒绝该请求,因为内容长度超过配置的值。 在<configuration>节点下配置以下内容: <system.webS……
<<上一篇
下一篇>>