4

When I am trying to upload file of 32MB, firefox is showing following error on page.

" The connection was reset. The connection to the server was reset while the page was loading."

I have tried foll. solutions -

1 . in <system.web>

<httpRuntime maxRequestLength="2000000000" executionTimeout="999999"/>

2 . in <system.webserver>

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

and

<compilation defaultLanguage="c#" debug="false" />

but still getting same error. I think problem is related to "executionTimeout". Application is not setting this timeout for request.

Abhi
  • 1,963
  • 7
  • 27
  • 33

3 Answers3

6

Finally problem resolved... We need to keep both tags in config file. i.e.

<httpRuntime maxRequestLength="2000000000" executionTimeout="999999"/>

and

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

Actually I was commenting one line and testing with another. :)

Tim S. Van Haren
  • 8,861
  • 2
  • 30
  • 34
Abhi
  • 1,963
  • 7
  • 27
  • 33
2

First: Notice that maxRequestLength is in KB whereas maxAllowedContentLength is in bytes
So you're just allowing 1MB... Increase your maxAllowedContentLength, for instance:

<requestLimits maxAllowedContentLength="2000000000" />

Second: Try a higher execution time such as executionTimeout="999999"

Blachshma
  • 17,097
  • 4
  • 58
  • 72
  • maxRequestLength in KB and 40960 KB = 40 MB. I have set that to 1000000 i.e. 976 MB. i tried. Still getting same error. – Abhi Dec 18 '12 at 14:23
  • Lets make this even simpler, please update the question with your CURRENT config, both system.web and system.webserver. – Blachshma Dec 18 '12 at 14:39
  • @Balchshma: I have tested in internet explorer and chrome as well.. not working. – Abhi Dec 18 '12 at 14:49
  • Are you SURE you're updating the web.config which is in the ROOT directory of your application?!? Also, is it in the same directory into which you're trying to upload the file? – Blachshma Dec 18 '12 at 15:01
  • Since you've maxed the values and it should be fine. And you're saying you're sure the web.config is in the correct place. Without you having access to the IIS and/or running iisrest I'm afraid I can't help anymore.. – Blachshma Dec 18 '12 at 15:07
  • 1
    @Abhi But one more tip - If you see the limit is ~30 MB, then since IIS 7 restricts by default maximum allowed content length for a request to 30 MB. It probably has something to do with settings on the IIS server, which doesn't let you override the `maxAllowedContentLength` value and you'll *need* access to the server. – Blachshma Dec 18 '12 at 15:13
0

I have solved the issue and set: <httpRuntime maxRequestLength="2097151" executionTimeout="999999"/> inside tag in the web.config file.

if maxRequestLength="2000000000" does not support then use the range 0-2097151

Hope this helps.

Rashedul.Rubel
  • 3,446
  • 25
  • 36