tags:

views:

64

answers:

1

Hi,

I'm facing a big issue IMO.

First, here's my code:

    .bind('uploadSuccess', function(event, file, serverData){
        if(serverData === 'nofile') {
            var swfu = $.swfupload.getInstance('#form');
            swfu.cancelUpload(file.id); // This part is not working :(
        } else {
            alert('File uploaded');
        }
    })

In this part I'm checking server response (I'm have strict validation restrictions). Now my question. Is it possible to remove uploaded file from queue? Basically, if server returns error I display error message, but... this file still exsit in the queue (I've implemented checking filename and filesize to avoid duplicated uploads) and user is not possible to replace this file (due to upload and queue limit).

I was trying to search for a solution, but without success. Any ideas?

Regards,
Tom

A: 

From the link

http://swfupload.org/forum/generaldiscussion/881

"The cancelUpload(file_id) function allows you to cancel any file you have queued.

You just have to keep the file's ID value so you can pass it to cancelUpload when you call it."

Probably you have to keep the file ID before sending anything to the server

jaderanderson