Because I am constantly busy working on something, I have never had time to actually put everything in words and pictures. But, since you got here, then you must have already seen some part of my work - and this is the way I’m talking.I'm 23, born in Romania, student at UPG Romania in software development field. I started from 0, mostly with basic stuff, and I’m evolving every day to an expert. I'm focused on freelancing projects, from small websites, to really heavy stuff. I know that I look and act differently from most developers, but this is why you will love to work with me!

Tuesday, December 18, 2012

Fixing nsIDOMLSProgressEvent.input error


Fixing error "NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMLSProgressEvent.input]" for PrimeFaces p:fileUpload

I found this solution on internet and I think it deserve to be shared. Adding this JS code fixes the above upload error:


$.blueimp.fileupload.prototype._initProgressListener = function (options) {
    var that = this,
    xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
    // Accesss to the native XHR object is required to add event listeners
    // for the upload progress event:
    if (xhr.upload) {
        $(xhr.upload).bind('progress', function (e) {
            var oe = e.originalEvent;
            // Make sure the progress event properties get copied over:
            e.lengthComputable = oe.lengthComputable;
            e.loaded = oe.loaded;
            e.total = oe.total;
            that._onProgress(e, options);
        });
        options.xhr = function () {
            return xhr;
        };
    }
}

4 comments:

Anonymous said...

cheers!

tom smith said...

It was nice to see the best place learn
Datastage Online Training and to see best place..

David<br>"Blue" Lahti said...

Thanks for this - your snippet saved me hours of headache!

Patricia said...

Thanks, but where should I put this code?