技术交流 > 心得分享 > IIS 413【未显示页面,因为请求实体过大】 的解决方案

IIS 413【未显示页面,因为请求实体过大】 的解决方案

1.Cmd命令设置UploadReadAheadSize的大小

进入 cd C:\Windows\System32\inetsrv 目录执行命令
成功后再次输入:

appcmd.exe list config -section:system.webServer/serverRuntime            
(此操作可以查看当前设置的 UploadReadAheadSize 的大小(byte))


进行对比,如果设置的UploadReadAheadSize 大小与需求不匹配,进行调整:(200Mb)

appcmd.exe set config -section:system.webServer/serverruntime /uploadreadaheadsize:209715200

按照需求将大小调整为所需即可


2.配置web.config文件

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>
        <!--单位:千字节(KB) (200Mb)-->
        <httpRuntime maxRequestLength="204800" useFullyQualifiedRedirectUrl="false" executionTimeout="3600"/>
  </system.web>

  <system.webServer>
    <security>
      <requestFiltering>
        <!--单位:字节(b)。(200Mb) -->
        <requestLimits maxAllowedContentLength="209715200" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>


2022-01-10 16:03:13
评论
  • 评论加载中...

评论内容: