Resolution for large file upload problem in IIS

Source: Internet
Author: User

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 
  1. Maxrequestlength="2097151"//Max upload length
  2. Usefullyqualifiedredirecturl="true"
  3. executiontimeout="6000"//Maximum response time
  4. minfreethreads="8"
  5. minlocalrequestfreethreads="4"
  6. apprequestqueuelimit="
  7. enableversionheader="true"
  8. />
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 
    1. <system.webServer>
    2. <security>
    3. <requestFiltering>
    4. <requestlimits maxallowedcontentlength="2072576000"/>
    5. </requestFiltering>
    6. </security>
    7. </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.