SWFUpload on upload cycle complete redirect to new url

138 Views Asked by At

I'm using SWFUpload in Joomla backend component creation. I can upload images with this uploader finely. After Upload cycle completion I can't redirect to new url.

When I enter window.location.href="url" after upload call, it redirects to the said url but images are not uploaded and server(I/O) error is displayed.

Anyone please provide me a suggestion.

1

There are 1 best solutions below

0
Larry.Z On

You can redirect in upload_complete_handler like this

upload_complete_handler: function (file) {
    var num = this.getStats().files_queued ; //num is the count of file in queue
    if(num == 0){
           window.location.href = 'http://url.you.want.to.redirect';
    } else {
        this.startUpload(); //next file in queue
    }
},