C# upload file error code 500, the upload file is too large

1 When the C# upload interface is used instead, the ajax request fails, error code 500, and there is no problem with the code, please check the Web.config of the background interface program, and configure the httpRuntime tag in system.web. The default upload file limit of the program is 4M , you need to set the size of the uploaded file according to the project requirements. Add the following code

<system.web>
    <compilation targetFramework="4.6.1" debug="true" />
    <!--最大请求长度,单位为KB(千字节),默认为4M,设置为40M,上限为2G -->
    <httpRuntime targetFramework="4.6.1" maxRequestLength="40960" executionTimeout="3600" />
  </system.web>

Guess you like

Origin blog.csdn.net/zhang123csdn/article/details/132224846