Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net file upload The connection to the server was reset while the page was loading

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.

like image 296
Abhi Avatar asked Feb 18 '23 03:02

Abhi


2 Answers

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. :)

like image 75
Abhi Avatar answered May 12 '23 02:05

Abhi


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"

like image 41
Blachshma Avatar answered May 12 '23 03:05

Blachshma