flowjs / flow.js

A JavaScript library providing multiple simultaneous, stable, fault-tolerant and resumable/restartable file uploads via the HTML5 File API.
Other
2.96k stars 346 forks source link

When uploading an empty file the progress function report incorrect value #302

Open evilaliv3 opened 4 years ago

evilaliv3 commented 4 years ago

I just tried to load an empty file and i nocided that the progress() function continues to report 0 after completion of the upload.

@AidasK: I've still to look at the code but maybe you have already an idea about this possible errore

AidasK commented 4 years ago

https://github.com/flowjs/flow.js/blob/master/src/flow.js#L571 🥇 It should return 1 if request was made. It's a bug

evilaliv3 commented 4 years ago

What do you think should be the right fix without refactoring the whole code?

AidasK commented 4 years ago

I might be wrong, but it might not be a bug in place I pointed above. Chunk requests actually are always bigger than 0 bytes even though file uploaded is 0 bytes. This is because request contains headers. You should test out each progress function in flow.js to find which part might cause this issue. There are 3 progress functions: chunk, file and total. Try adding some breakpoints and fixing one should fix the others as well.

PhilippEichhorn commented 3 years ago

Hi, is there any solution for this "bug" ? im stuck with the same error

@evilaliv3 did you find any solution?