Search code examples
asp.netiis-7

maxAllowedContentLength do not work for IHttpHandler IIS7


I have ASP.NET IHttpHandler module which handle file uploads. I set file size limit to 50mb in config file

  <system.webServer>
   <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="52428800" />
      </requestFiltering>
    </security> 
  </system.webServer>

But still get error while uploading 13mb file.

System.Web.HttpException (0x80004005): Maximum request length exceeded.

How to increase default allowed file size?


Solution

  • Use the following under the in web.config of web application

    <httpRuntime maxRequestLength="52428800" />