Removing an uploaded file

242 views
Skip to first unread message

dancablam

unread,
Jan 2, 2011, 10:40:31 PM1/2/11
to SWFUpload
I have the file_upload_limit set to 5 files. However if I successfully
upload 5 files but then I wish to remove one or more of them how can I
remove it from swfupload so that it won't give a QUEUE_LIMIT_EXCEEDED
error? In other words - if I upload 5 files, delete 1 (or 2,3,4,5) of
the files, and then try to upload another file I get the
QUEUE_LIMIT_EXCEEDED error even though there are <= 5 total files.

I currently do a POST to the server to remove the file on the server
side and do some JS to remove the file from the DOM but no matter what
I try I can't seem to remove a file from the queue once it's been
successfully uploaded (cancelUpload obviously doesn't work because the
file has already been uploaded).

Anyway to adjust the queue count when a file is removed so this
doesn't happen?

Thanks!
~Dan

Nautiljon

unread,
Jan 3, 2011, 6:41:34 AM1/3/11
to SWFUpload
I Have the same problem.

I think we need to decrement a variable (a variable that know how many
upload were successful) in the swfupload class file or something like
that. Removing from the dom does nothing :/
If you found the answer share it please ^^

dancablam

unread,
Jan 3, 2011, 3:50:42 PM1/3/11
to SWFUpload
I think I've found a solution via the setStats() method:

var swfu = $.swfupload.getInstance('#swfupload-control');
var stats = swfu.getStats();
stats.successful_uploads--;
swfu.setStats(stats);

Cheers,
Dan

Sunil Sheoran

unread,
Aug 1, 2012, 12:06:59 PM8/1/12
to swfu...@googlegroups.com
Thanks Dancablam! This worked out of the box. I would say SWFUpload is terrible if not for the client side image resizing feature. That's the only reason I use it.
Reply all
Reply to author
Forward
0 new messages