views:

23

answers:

2

I have a web site on IIS7. I can upload a maximum of 100KB, but if I try any files larger than 100K then I get a timeout error.

I have added following setting to my web.config file but I am getting the same error:

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2000000000"></requestLimits>
  </requestFiltering>
</security>

What could be wrong?

A: 

You might also want to check your <httpRuntime> element in the web.config to ensure that it isn't limiting your request size there.

Mitchel Sellers
thanks your answer, but there is no limit: httpRuntime maxRequestLength="4096"
onder
A: 

Try increasing the HttpServerUtility.ScriptTimeout property. You can do this in your script:

Server.ScriptTimeout = 300; // Set timeout to 300 seconds

Or you can configure in your web.config in:

<configuration>
  <system.web>
    <httpRuntime 
       executionTimeout = "300"
    />
  </system.web>
</configuration>

For more info see:

httpRuntime Element (ASP.NET Settings Schema)

Kev