0

I am using .net 4.5. I set maximum request length and maxAllowedContentLength in config file as 100 mb. When I try to upload larger than 100 mb file (like 200mb to 1000mb) I am getting an error

The request filtering module is configured to deny a request that exceeds the request content length

This is normal and expected error but when I try to larger than 1 gb, I am getting error "internet explorer cannot display page".

I think it is due to a timeout issue but I really can't figure out actual reason of this error.

Thank u.

Stedy
  • 7,359
  • 14
  • 57
  • 77
  • Look at this answer, is for download, but take a look of it and focus on the session lock http://stackoverflow.com/questions/9600856/how-to-deliver-big-files-in-asp-net-response/9601866#9601866 – Aristos Mar 13 '13 at 22:53

2 Answers2

2

This has been asked about on StackOverflow many times. I'll continue the tradition :) For large uploads you need to set two parameters:

  • maxAllowedContentLength is measured in bytes, so make sure you've actually set it correctly. To allow 1GB uploads, it should be 134217728.

  • You also need to configure maxRequestLength as well as maxAllowedContentLength. Note though that it is measured in kilobytes, so it will be different.

For example:

<configuration>
    <system.web>
        <httpRuntime maxRequestLength="1048576" />
    </system.web>
</configuration>

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="1073741824" />
        </requestFiltering>
    </security>
</system.webServer>
kiddailey
  • 3,302
  • 3
  • 22
  • 23
0

It's a little unclear, but what I think you're running into is IIS's normal behavior reguarding exceptions: any issue with the request returns a 500 server error response.

In oder to view exceptions you can either disable this behavior in the configuration file (MSDN Link), or transfer the file while logged into the server (connections from localhost bypass this behavior by default).

Christopher Stevenson
  • 2,843
  • 20
  • 25