vue-formulate icon indicating copy to clipboard operation
vue-formulate copied to clipboard

Asynchronous file upload or an event to see if all uploads are done

Open MarijnSt opened this issue 3 years ago • 0 comments

I have a file input that accepts multiple files and a custom uploader to upload them. It works fine for one file but it seems that multiple files are uploaded separately and synchronously which causes an issue when I try to upload them.

In my case each upload needs an access token to be completed and when this token is expired, I trigger a function that refreshes the tokens to try the upload again. But because the files are all uploaded at the same time, I'm having issues refreshing the tokens. It will fail on one file and trigger the refresh function but the other files don't use these updated tokens because their upload has already started before the refresh function was triggered.

I removed the function to refresh the tokens from my uploader but then I don't have a way to determine that all uploads are done and that I can refresh my tokens to eventually retry the upload.

I tried looking for a way to fix this issue with what is in the documentation but I can't find anything. Is there a way to solve this? If not, it would be nice to have in the future.

MarijnSt avatar Sep 09 '22 09:09 MarijnSt