Large file upload Failed via ajax call
<p>Now I am working on File upload. So I had written a piece of code using ajax call. This is working perfectly when  I am uploading files (GB) from my local server. </p>

<pre><code>$.ajax({
    type: "POST",
    url: "process/uploadFlatFile.htm",
    enctype : 'multipart/form-data',
    //timeout: 0,
    crossDomain: true,
    data : formData,
    processData: false, 
    contentType: false,
    cache: false,
    dataType: 'json',
    xhr: function() {
        myXhr = $.ajaxSettings.xhr();
        //myXhr = new XMLHttpRequest();
        console.log("myXhr: " + myXhr.upload);
        if(myXhr.upload){
            console.log("adding progress event listener");
            myXhr.upload.addEventListener('progress', showProgress, false);
        } else {
            console.log("Upload progress is not supported.");
        }
        return myXhr;
    },beforeSend: function(xhr, opts) {
        console.log("beforeSend:xhr: " + xhr + ", opts: " + opts);
        currXhr = xhr;
        showProgressBar();
        status.empty();
        var percentVal = '0%';
        bar.width(percentVal);
        percent.html(percentVal);
        $(cancelSelector).removeAttr('disabled');
    },

    success: function(result,status,xhr) {
        console.log("success:result: " + result);
        console.log("success:status: " + status);
        console.log("success:xhr: " + xhr);
        var percentVal = '100%';
        bar.width(percentVal);
        //$("#fountainGG").hide();
        percent.html(percentVal);
        $.unblockUI({ 
            onUnblock: function(){  
                if(result=="success"){
                    console.log("SUCCESS PART :")

                    alertMessage("Success","File Uploaded Successfully","info");
                    setTimeout(function(){
                        window.location.href = "processFlow.htm";
                        //newProcessClicked('yes'); closeConDiv()
                    }, 2000);
                }else{

                    alertMessage("Error","Error in upload. Try Again !","info");
                }
            } 
        });
    },
    complete: function(xhr,status){
        console.log("COMPLETE PART :")
        console.log("complete:status: " + status + ", xhr: " + xhr);
        $('#btnGoUpload').prop('disabled', false);
    },
    error: function(xhr, statusText, err) {
        $.unblockUI();
        console.log("statusText: " +statusText);
        console.log("error: " + err);
        var msg = "Error in uploading file. Try Again !";
        if (err == "abort"){
            msg = "File upload aborted.";
        }
        alertMessage("Error",msg,"info");
    }
});
</code></pre>

<p>But when I am uploading  GB (above 30 Gb) files from public server it's going to error part of ajax call after couple of time. I think it is connection time out problem? If it is connection time out problem , how can I resolve it? </p>