fileFilter at processPending uploads all even if response is false #771
-
fileFilter at processPending uploads all files (with autoUpload false) even if response is false const uploady = useUploady(); uploady.processPending({ Expected behavior |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hey @OscarEstudilloMarin So, beyond documenting better this situation (there are other params that arent applied at this point), can you elaborate why you're setting the fileFilter at the point of calling |
Beta Was this translation helpful? Give feedback.
-
Hi @yoavniran, I'd like to explain why fileFilter in processPending is essential for our use case: In our application, we have a partner role that can perform various actions for different clients, including file uploads. Rather than implementing automatic uploads, we've designed a two-step process that allows for pre-upload actions. Here's how it works:
The expected behavior varies depending on the context:
I've attached a video demonstration to better illustrate this workflow. multiple-client-upload.mp4 |
Beta Was this translation helpful? Give feedback.
-
Thanks @OscarEstudilloMarin , I think fileFilter isn't the right tool here. I'd suggest using the "cancellable" event handlers/hooks for this purpose. Here's a guide that discusses cancalling uploads. Additionally, I think cancelling will allow you to build a UI that makes it clear what happened to the item that was added. filtering simply makes the item disappear as if it wasn't added, which may be confusing to the user. Alternatively, if you are able to determine whether files should be filtered out when they are added, but from a different location. It is possible to define the fileFilter at the UploadButton level (for example). This guide shows how you can override settings from the upload component. Hope this helps. For now, I'll move this to Discussions and you can reply there. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the explanation @yoavniran I was convinced fileFilter didn't remove the files so that is why I thought of using it. I'll investigate cancellable events in order to achieve the expected functionality. Thank you very much for your help and for your kindness creating this library 🙌🏽 |
Beta Was this translation helpful? Give feedback.
Thanks @OscarEstudilloMarin ,
its much clearer now.
I think fileFilter isn't the right tool here. I'd suggest using the "cancellable" event handlers/hooks for this purpose.
fileFilter was designed to filter out files immediately when they're added and not after they're in the queue.
Here's a guide that discusses cancalling uploads.
Additionally, I think cancelling will allow you to build a UI that makes it clear what happened to the item that was added. filtering simply makes the item disappear as if it wasn't added, which may be confusing to the user.
Alternatively, if you are able to determine whether files should be filtered out when they are added, but from a different location. It is…