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.