1

I am trying to use resumable.js for my application for file uploads. It works fine and uploads the file.

Problem occurs if after a file is uploaded successfully, I try to select or drop same file again, it does not trigger the file upload(r.upload()) till i refresh the page.

Is there any way to clear file list from resumable obkect after all files are uploaded so that they can be selected again?

Also is there a way to introduce some delay(like sleep(5)) before sending another chunk to server.

pooja
  • 319
  • 1
  • 2
  • 21

1 Answers1

3

In the fileSuccess event you can call r.removeFile(file); to have the file removed once completed. This will clear the queue as you go and should allow you to upload more files. I suspect the reason it is not firing the upload() event is that you have reached the max files limit and refreshing the page clears the queue.

Should look something like this:

r.on('fileSuccess', function (file) {
    r.removeFile(file);
    console.debug('fileSuccess', file);
});
defect833
  • 275
  • 7
  • 22
  • This suggestion also appears to allow resumable.js to accept files with different names for additional uploads – we had the same issue where after the first successful upload, it would no longer fire the relevant events until the page was reloaded, by adding the `r.removeFile(file)` to the `fileSuccess` event callback as detailed above, it now works perfectly! Thanks for the great tip! – bluebinary Feb 12 '16 at 08:05