Request filtering on the WEB server is configured to reject the request because the content length exceeds the configured value. "
This problem in the development needs to upload files may encounter, today encountered this problem, hundred spent also has a lot of modification methods.
Method 1:
Modifying the applicationhost.config of IIS
File Location:%windir%/system32/inetsrv/config/applicationhost.config
Or
%windir%\system32\inetsrv\config\applicationhost.config
Locate the <requestFiltering> node, which defaults to the <requestlimits maxallowedcontentlength= "Upload size value (in bytes)"/> element under the node. Add the following elements for this node:
<requestlimits maxallowedcontentlength= "2147483647"/> (upload size will be changed to 2G)
But I found that there was no such path, and later on did not install IIS (on someone else's computer, usually directly with VS debugging run, not to control it),
But after the change, it will still go wrong (maybe I added the position is not correct?) The <requestFiltering> node should be right).
Method 2:
Add the following in Web. config:
<configuration>
<system.web>
"2097151" executiontimeout="/> "
</system.web>
</configuration>
It is still useless to add it through practice. It's killing me.
Later, I looked carefully at some of the error page tips how to:
“
- Confirm the Configuration/system.webserver/security/requestfiltering/[email in the ApplicationHost.config or Web. config file Protected] settings.
”
Configured in the applicationhost.config No, then I configure the file configuration to see it
So I added the configuration node under the Web. config
<system.webServer>
<security>
<requestFiltering>
<requestlimits maxallowedcontentlength= "2147483647"/>
</requestFiltering>
</security>
</system.webServer>
Finally done.
PS: It's useless in applicationhost.config. I think it should be, it is the configuration of the local IIS, and I this debugging time with the VS iisexpress, so it is not used, do not know right
ASP. NET Development issue: Request filtering on the WEB server is configured to reject the request because the content length exceeds the configured value.