Asp.net: the IIS [Request Filtering module is configured to reject requests that exceed the length of the request content] Solution

Source: Internet
Author: User

Solution

1. Modify IIS applicationhost. config

A. File Location: % WINDIR %/system32/inetsrv/config/applicationhost. config

B. Find the <requestfiltering> node.

C. Add the following elements to the node: <requestlimits maxallowedcontentlength = "2147483647"/> (the upload size will be changed to 2 GB)

Note: by default, no <requestlimits maxallowedcontentlength = "upload size value (unit: byte)"/> element exists for this node.

2. Add the following content to Web. config:

<Configuration>

<System. Web>

<Httpruntime maxrequestlength = "2097151" executiontimeout = "120"/>

</System. Web>

</Configuration>

CopyCodeNote:
Httpruntime: Configure ASP. net http runtime settings to determine how to handle ASP. NET ApplicationsProgram.
Maxrequestlength (indicating the maximum file upload size supported by ASP. NET)
Specify the input stream buffer threshold (in KB ). This restriction can be used to prevent denial-of-service attacks. For example, a denial-of-service attack caused by a large file being sent to the server.
The default value is 4096 (4 MB), and the maximum value is only 2097151 kb.
Executiontimeout: specifies the maximum number of seconds allowed to execute a request before it is automatically disabled by ASP. NET. The default value is 90 seconds.
This timeout attribute applies only when the debugging attribute in the compilation element is false. To help avoid shutting down the application during debugging, do not set this timeout attribute to greater than timeout.

3. In web. config, add the following content to the <system. webserver> node.

<Security>

<Requestfiltering>

<Requestlimits maxallowedcontentlength = "2147483647"> </requestlimits>

</Requestfiltering>

</Security>

In the preceding example, maxallowedcontentlengt is in BK.

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.