IIS WebApi: file upload size restrictions, prompting 413 (Request Entity Too Large)

 

I think if someone follow my title search results, are addressed in the linux system solutions, or java. . . .

In fact, the direction of solving this problem on IIS, so you go to search " IIS settings file upload size limit is set method ", there will be a bunch of answers you want. I have not posted.

 

net (C #) project: When you want to upload, the file is too large, the newspaper 413, there are two solutions.

First, in the web.config configuration, the following standard red bold place, copy the following format in a corresponding position to the web.config, it can be solved.

Note: The two red mark at all you want to copy, configure! ! !

    httpRuntime in maxRequestLength is to set the size limit to upload your files;
    requestLimits in maxAllowedContentLength is to set the size limit to upload your files;
<configuration>
  <system.web>
    <compilation targetFramework="4.6.1" />
    <httpRuntime executionTimeout="600" maxRequestLength="419430400" targetFramework="4.6.1" />
  </system.web>
  <system.webServer>
    <security>
        <requestFiltering>
           <requestLimits maxAllowedContentLength="419430400" />
        </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Two, IIS is configured

① Open IIS, locate the project file to upload, select -> function attempts -> Configuration Editor (see below)

 

 

 ② modify two (httpRuntime, requestLimits)

 

 

 

 

 

Above can be solved file is too large to upload to this problem.

 

Do not understand what can feel free to comment, I will return to see the oh ~

See this, the little master adults, shop unless, like the point of a white ~

 

Guess you like

Origin www.cnblogs.com/pukua/p/12598091.html