title: IIS7 - The request filtering module is configured to deny a request that exceeds the request content length
body: <p>I want to upload images, it works fine on my machine but when I put my website on IIS7 server for public I can't upload anything.</p>
  
  <h2>Error</h2>
  
  <blockquote>
    <p>The request filtering module is configured to deny a request that
    exceeds the request content length.</p>
  </blockquote>
  
  <h2>Most likely causes</h2>
  
  <blockquote>
    <p>Request filtering is configured on the Web server to deny the request
    because the content length exceeds the configured value.</p>
  </blockquote>
  
  <h2>Things you can try</h2>
  
  <blockquote>
    <p>Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength
    setting in the applicationhost.config or web.config file.</p>
  </blockquote>
  
  <h2>system.webServer in Web.config</h2>
  
  <pre><code>  &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;
      &lt;modules runAllManagedModulesForAllRequests="true" /&gt;
      &lt;security&gt;
        &lt;requestFiltering&gt;
           &lt;requestLimits maxAllowedContentLength="1048576" /&gt;
        &lt;/requestFiltering&gt;
     &lt;/security&gt;
    &lt;/system.webServer&gt;
  </code></pre>
  
  <p>As you can see I set my maxAllowedContentLength to 1gb. Restarted my website and still getting this error. I made an <code>/uploads/</code> folder on my file system where it suppose to be as well. Have no idea what causes this error and why I can't upload images.</p>