IIS limited the upload of large files for security reasons, and Baidu on the Internet to the majority of the solution is to use an administrator rights Notepad to open a file modification parameters, but I found that there is no online said those parameters, Finally, I found a way to modify the webconfig of the publish file to resolve IIS restrictions on large file uploads.
First, add the following code to the system.web
[CSharp]View PlainCopy
- Maxrequestlength="2097151"//Max upload length
- Usefullyqualifiedredirecturl="true"
- executiontimeout="6000"//Maximum response time
- minfreethreads="8"
- minlocalrequestfreethreads="4"
- apprequestqueuelimit="
- enableversionheader="true"
- />
This is also on-line Baidu answer more of the addition, here to modify the maximum upload length of 2097151kb is 2G, you can modify the size according to their own needs. While the Executiontimeout property is used to limit the response time of the file upload server, that is, if the network speed is slow, uploading files of the same size may require longer response times, otherwise the upload size limit is not reached but is rejected by ISS because of an upload timeout.
But the above method is still not enough, we also need to add a very important thing to modify the properties in IIS, the first success is to open the IIS corresponding to the published file
1. Open IIS Select the bottom item of the right property of the page you are publishing
2. Open after opening according to this path: system.webserver/security/requestfiltering
3. Modify the size limit of the represented part in byte (maximum in the figure)
This place defaults to 30000000byte, and I modified it to the maximum limit for IIS 2G (less than 2G). This method of modification is not once and for all, and it will be reset to 30000000byte if you republish or re-select another release file.
So the final workaround is to add the following code (outside of system.web) to the webconfig of the published file:
[CSharp]View PlainCopy
- <system.webServer>
- <security>
- <requestFiltering>
- <requestlimits maxallowedcontentlength="2072576000"/>
- </requestFiltering>
- </security>
- </system.webServer>
This way, no matter what IIS app you publish it by default, it will automatically be set to 2G when the site is loaded (you can modify this size to suit your needs).
The above is the large file in IIS upload Limited solution, I hope to help everyone.
Resolution for large file upload problem in IIS