Asp.net development problem: the Web server's request filtering is configured to reject this request because the content length exceeds the configured value ., Asp. netweb

Source: Internet
Author: User

Asp.net development problem: the Web server's request filtering is configured to reject this request because the content length exceeds the configured value ., Asp. netweb

 "Web Server Request filtering is configured to reject this request because the content length exceeds the configured value. "

This problem may occur when the development needs to upload files. Today, Baidu has many ways to modify it.

 

Method 1:

Modify IIS applicationhost. config
File Path: % windir %/system32/inetsrv/config/applicationhost. config
Or
% Windir % \ system32 \ inetsrv \ config \ applicationhost. config
Find the <requestFiltering> node. By default, the <requestLimits maxAllowedContentLength = "upload size value (unit: byte)"/> element does not exist in this node. Add the following elements to the node:
<RequestLimits maxAllowedContentLength = "2147483647"/> (the upload size is changed to 2 GB)

 

However, I found that this path was not found, and later I found that IIS was not installed (I did it on someone else's computer and used vs for debugging and running at ordinary times without worrying about it ),

However, after modification, an error still occurs (maybe the location I added is not correct? <RequestFiltering> the node should be correct ).

 

Method 2:

Add the following content to web. config:

<Configuration>

<System. web>

<HttpRuntime maxRequestLength = "2097151" executionTimeout = "120"/>

</System. web>

</Configuration>

 

 

It is useless to add it through practice. I am in a hurry.

 

Later, I carefully read some practical methods for error page prompts:

"

  • Confirm the configuration/system. webServer/security/requestFiltering/requestLimits @ maxAllowedContentLength settings in applicationhost. config or web. config.

"

 

InApplicationhost. config cannot be configured. Check the configuration in the configuration file.

So I add

<System. webServer>
<Security>
<RequestFiltering>
<RequestLimits maxAllowedContentLength = "2147483647" type = "codeph" text = "/codeph"/>
</RequestFiltering>
</Security>

</System. webServer>

 

Finished.

 

Ps: InApplicationhost. config is useless. I think it should be because it is the configuration of local iis, And I used vs iisExpress for debugging, so it is useless.

 

 

 

 

Related Article

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.