how to stop an in-process upload in plupload

user669677 picture user669677 · Apr 21, 2012 · Viewed 7.8k times · Source

up.removeFile(file) works only if the upload is not in progress.

Is this a bug, or exists some other function I missed to call?

Answer

user669677 picture user669677 · Apr 21, 2012

This way I could make it work.

Every added files has it own cancel function:

var status_before = file.status;
up.removeFile(file);                
if(up.state == plupload.STARTED && status_before == plupload.UPLOADING)
{
  up.stop();
  up.start();
}