Timeout when doing ajax file upload
<p>I have the user to select a single file to upload. But the upload will never finish in a very weird case.</p>

<p><strong>Working use case</strong>: Once the page finishes loading, the user picks a file and upload, it always uploads.</p>

<p><strong>Not working use case</strong>: Once the page finishes loading, the user stares at the screen for a minute or two and then pick a file to upload, the upload almost never finish. We don't know how long of a stare is enough, but 2 to 5 minutes will usually do. The problem appears only happening in IE 11 on a Windows 7 machine. On the same machine, Chrome and Firefox works fine. The IIS web server is not load balanced but it also happens on load balanced environment. When the upload never finishes, the controller expecting the POST never gets the request and the IIS log never gets the POST request either.</p>

<p><strong>Update:</strong>
I found out that the development web server is a single server, but it's actually behind a load balance environment because our QA environment has two web servers and load balanced. With that said, in appears the problem is caused by the load balancer. Because if the file is POSTed to the server URL by node name, the upload works. But if POSTed to the load balancer, it fails. I'll see if my network guys can find a solution. I don't believe this is a code problem, or am I wrong?</p>

<pre><code>var FormEdit = function () {
    var that = {};

    that.upload = function () {
        var data = new FormData();
        var fileInput = $('#fileInput')[0];
        var file = fileInput.files[0];
        data.append(file.name, file);

        $.ajax({
            type: 'post',
            dataType: 'json',
            url: url,
            data: data,
            processData: false,
            contentType: false,
        }).fail(function () {
        }).then(function (data) {
        }).always(function () {
        });
    };
};
</code></pre>