views:

225

answers:

2

I am using yui-uploader from YUI 2.6.0

When an upload error occurs, I disable the uploader, show a warning, and then when the user clicks ok, enable it again.

Subsequent to this, selection of new files works, and the file list is populated correctly. However the uploads do not start. Has anyone encountered this problem? How do you handle restarting with the uploader? Will I need to destroy and recreate the object itself?

In the case where there is no error, I am able to successfully choose (say) 3 files, wait for them to upload, choose 3 more, let those upload, etc.

A: 

i have not found a solution without actually reloading the page itself, so that said, the solution is a page reload.

Greg R
I was iirc able to obtain the same behavior by re-creating the YUI uploader object on error.
nunb
A: 

To expand on what I wrote earlier, the solution I ended up with is to re-create the JS object.

Something like:

function create_uploader() {
        YAHOO.widget.Uploader.SWFURL = "/pub/uploader.swf";
        uploader = new YAHOO.widget.Uploader('uploadercontainer');
        uploader.addListener('contentReady', handleContentReady);
        .. etc ..
}

function onUploadError(event) {
        alert('was not able to upload, check your connection and try again');
        create_uploader(); 
}
nunb