Connection interrupted while uploading large files in browser (.NET application)

Posted on 2009-04-25
Last Modified: 2012-05-06
I have a website which allows users to upload large video files. Some of these files can be over 50MBs.

I've updated the web.config file to allow for files up to 2GB to upload (and run for 60 minutes):
<httpRuntime maxRequestLength="2048000" executionTimeout= "3600"  />

I can upload a 20MB file but when I try uploading an 80MB file, the browser times out and displays this error:

Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again.

What else can i do to ensure that the connection will be interrupted? Are there changes in IIS that can be applied? To the server itself (Windows Server 2003 / SQL Server 2005)?


Question by:bearclaws75
    LVL 9

    Expert Comment

    in your webconfig increase your connection timeout.
    LVL 9

    Accepted Solution

    Some Custom Upload modules that u can use

    Also try using
    <httpRuntime maxRequestLength="2048000"  />

    let us know what is the outcome. Also if you can keep track of how much data was uploaded and after how long the error occurred. this can point to where you should be looking into to solve it

    Author Comment

    I updated my web.config (and machine.config) to use the following settings:

          <httpRuntime executionTimeout="7200" maxRequestLength="2048000"
          minFreeThreads="8" minLocalRequestFreeThreads="4"
          appRequestQueueLimit="100" />

    In IIS, I set the "connection timeout" value to "7200".

    Now, I receive a new error. This error is actually a .NET error (not a browser error).

    It states that the maximum request length has been exceeded, however, the maxRequestLength is set to 2GB and the file I am uploading is only 50MB.

    Any ideas?

    Server Error in '/' Application.
    Maximum request length exceeded.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Web.HttpException: Maximum request length exceeded.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [HttpException (0x80004005): Maximum request length exceeded.]
       System.Web.HttpRequest.GetEntireRawContent() +3315778
       System.Web.HttpRequest.GetMultipartContent() +56
       System.Web.HttpRequest.FillInFormCollection() +222
       System.Web.HttpRequest.get_Form() +65
       System.Web.HttpRequest.get_HasForm() +3309630
       System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +45
       System.Web.UI.Page.DeterminePostBackMode() +65
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +133

    Open in new window

    LVL 9

    Expert Comment

    if you are using cookieless session then use

    useFullyQualifiedRedirectUrl = "True"

    LVL 9

    Expert Comment

    another thing i would suggest is look into IIS Log File to see the exact error. also if you can catch the error in the application then you will know exactly whats happening

    Author Closing Comment

    We were unable to fix this via the server or application configuration settings. We decided to you an existing 3rd party uploader to resolve this issue.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now