kqito / use-tus

React hooks for resumable file uploads using tus
https://kqito.github.io/use-tus/?path=/story/usetus--basic
MIT License
104 stars 8 forks source link

Uploading multiple files - 1 file missing #50

Closed NunoBento closed 8 months ago

NunoBento commented 8 months ago

Attempting to upload multiples files, i noticed all files are upload execpt 1, always. If i select 5 files, only 4 are successfully uploaded.

These logs show the use state null image

I modified your Basic.stories.tsx , added multiple on input type file. Then, used all files instead of 1.

const files = event.target?.files;
for (let index = 0; index < files.length; index += 1) {
  const file = files[index];

Not sure what is happening. Can you upload multiple files using use-tus?

UPDATE: the problem was in the for loop. Implemented a queue to upload 1 file at a time, it works as expected.