Closed middlebrain closed 10 years ago
Thanks for the report, I'll have a look at that. I'm not using the asynchronous upload, so I haven't tested it well.
The bug can be reproduced by selecting a big file first and then a smaller one.
Added a quick fix to the devel branch. Now during asynchronous upload after each finished upload instead of calling isLast()
, the new method existUploadingItems()
is called. It checks, if there are any active uploads by going through the queue items. There may be a way how to optimize that, but in case you don't upload hundreds files at once, that should be ok.
Please, test it if you have time.
P. S. I also added a checkbox to toggle synchronouse/asyhcnronous upload in the demo.
Wow, you are fast.
I have tested the asynchronous upload with your fix and it is working without problems now. Thanks.
It was not a big deal. It would be more challenging to implement a restriction for the maximum number of concurent uploads :).
Thank you for writing and sharing this great upload widget. It is a pleasure to read and learn from your code.
While playing around I have found a bug in the function Queue.js -> isLast(). In the asynchronous mode, the callback order ist mostly different from the request order. Therefore you can't finish the upload, if the last queue entry is calling back. I think to finish the upload you need a callback counter, which you have to compare with the number of entries in the queue or with the number of requests.
Here the result of this bug in firebug: