4

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?

Tomas
  • 17,551
  • 43
  • 152
  • 257

3 Answers3

2

To summarise, to raise the file upload size to 50 MiB in IIS7 add the lines below in the correct section of the Web.config file:

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

and

  <system.web>
    <httpRuntime maxRequestLength="51200" />
  </system.web>

1024 X 1024 X 50 = 5242880 bytes in 50 MiB

1024 X 50 = 51200 KiB in 50 MiB

AJ Dhaliwal
  • 661
  • 1
  • 8
  • 24
1

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

<httpRuntime maxRequestLength="52428800" />
Mansoor Gee
  • 1,071
  • 8
  • 20
0

For classic ASP users also check this settings in addition to the web.config settigns:

IIS > CLick on Website > ASP > Limit Properties > Maximum request entity body limit

Ali Sheikhpour
  • 10,475
  • 5
  • 41
  • 82