Solutions to the problem of uploading large files in ASP.NET and IIS

Today, the website failed to upload a picture with a size of tens of meters, and it prompted  the server responded with a status of 413 (Request Entity Too Large), that is , the requested entity content is too large, because the file was uploaded with the ckfinder plugin, so I want to find it. It's not where the ckfinder plugin limits the size, but I didn't find a place that can be modified, so I think it should be restricted by iis.

  Ever since, I checked the website configuration file Web.config and first modified and added the following code in the system.web tag

<system.web>
    <!--maxRequestLength表示ASP支持的最大请求大小,上传文件要设置大一点-->
    <!--单位:KB 3072=3MB   默认是4MB,最大支持2GB-->
  <httpRuntime maxRequestLength="51200000" executionTimeout="6000" ></httpRuntime>
 </system.web>

After the test, it was found that the problem has not been solved, so the following code was added

   <system.webServer>
    <security>
      <requestFiltering>
        <!--maxAllowedContentLength指定IIS支持的请求中内容的最大长度,上传文件要设置-->
        <!--单位:字节B  2147483648=2 GB 默认是4MB,最大支持2GB-->
        <requestLimits maxAllowedContentLength="2072576000"/>
      </requestFiltering>
    </security>
  </system.webServer>

Finally, the problem of file upload size limitation is solved.

Guess you like

Origin blog.csdn.net/QRcode_Y/article/details/108241638