IIS7. The request filtering module is configured to refuse a request that exceeds the length of the request content

I want to upload images, it works fine on my machine, but when I host my site on the IIS7 server for the public, I can’t upload anything.

Error

The request filtering module is configured to refuse a request that exceeds the length of the content of the request.

Most likely causes

Request filtering is configured on the web server to refuse the request because the length of the content exceeds the configured value.

What you can try

Check the configuration / system_webServer / security / requestFiltering / requestLimits @ maxAllowedContentLength in the applicationhost.config or web.config file.

system.webServer in Web.config

<system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true" /> <security> <requestFiltering> <requestLimits maxAllowedContentLength="1048576" /> </requestFiltering> </security> </system.webServer> 

As you can see, I set my maxAllowedContentLength to 1gb. Reloaded my site and still getting this error. I created the folder /uploads/ in my file system, where it should be. I don’t know what causes this error and why I cannot upload images.

+44
iis iis-7 asp.net-mvc-3
Jun 03 '12 at 16:12
source share
2 answers
 <configuration> <system.web> <httpRuntime maxRequestLength="1048576" /> </system.web> </configuration> 

From here .

+35
Jun 03 2018-12-12T00:
source share

In the following example, the Web.config file will configure IIS to deny access for HTTP requests where the "Content-type" header is longer than 100 bytes.

  <configuration> <system.webServer> <security> <requestFiltering> <requestLimits> <headerLimits> <add header="Content-type" sizeLimit="100" /> </headerLimits> </requestLimits> </requestFiltering> </security> </system.webServer> </configuration> 

Source: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits

+3
Jan 12 '15 at 18:14
source share



All Articles