ASP.NET - still not able to solve y problem on uploading large size of files

Asked By mani on 14-Feb-12 06:22 AM
hi..sorry for posting again,,because i made lot of changes in my webconfig but i am having same problem when uploading
is

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

          The site could be temporarily unavailable or too busy. Try again in a few
          moments.
          If you are unable to load any pages, check your computer's network
         connection.
         If your computer or network is protected by a firewall or proxy, make sure
         that Firefox is permitted to access the Web.


and in my webconfig is

<httpRuntime maxRequestLength="4194304" executionTimeout="2400" />
Somesh Yadav replied to mani on 14-Feb-12 06:32 AM

Try this

httpRuntime maxRequestLength="1097152" executionTimeout="100000000"/>and remove Server.ScriptTimeout=100000000;

Hope this helps..;

mani replied to Somesh Yadav on 14-Feb-12 06:48 AM
hi..i used u r code but still i am getting connection was reset page..
do i have to chatnge anything in server???or else??
Sreekumar P replied to mani on 15-Feb-12 08:37 AM
Increasing the Maximum Upload Size

The 4MB default is set in machine.config, but you can override it in you web.config. For instance, to expand the upload limit to 20MB, you'd do this:

<system.web>
  <httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>

Since the maximum request size limit is there to protect your site, it's best to expand the file-size limit for specific directories rather than your entire application. That's possible since the web.config allows for cascading overrides. You can add a web.config file to your folder which just contains the above, or you can use the <location> tag in your main web.config to achieve the same effect:

<location path="Upload">
  <system.web>
    <httpRuntime executionTimeout="110" maxRequestLength="20000" />
  </system.web>
</location>

What Happens When I Upload A File That's Too Big?

While expanding the upload restriction is a start, it's not a full solution for large file uploads. Milan explains one of the biggest problems with large file uploads in The Dark Side Of File Uploads:

It gets really interesting if someone uploads a file that is too large. Regardless of what your maxRequestLength setting mandates, IIS has to guzzle it, and then ASP.NET checks its size against your size limit. At this point it throws an exception.