JQuery: uploadProgress form plugin not called in IE8 / IE9

I am using jQuery form plugin (jquery.form.js) in my project. It works fine in Chrome / FF, but in IE8 / 9 the uploadProgress callback is not called. Even the demo on the official website http://jquery.malsup.com/form/progress.html does not update the download in IE8 / 9. Any hints? Thank.

+3
source share
1 answer

From source:

    if (options.uploadProgress) {
        // workaround because jqXHR does not expose upload property
        s.xhr = function() {
            var xhr = jQuery.ajaxSettings.xhr();
            if (xhr.upload) {
                xhr.upload.onprogress = function(event) {
                    var percent = 0;
                    var position = event.loaded || event.position; /*event.position is deprecated*/
                    var total = event.total;
                    if (event.lengthComputable) {
                        percent = Math.ceil(position / total * 100);
                    }
                    options.uploadProgress(event, position, total, percent);
                };
            }
            return xhr;
        };
    }

It uses the HTML5 function, which is not supported by ie8 / 9:

>> "upload" in new XMLHttpRequest 
false 
+8
source

All Articles