ASP. NET Development issue: Request filtering on the WEB server is configured to reject the request because the content length exceeds the configured value.

Source: Internet
Author: User

 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.

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.