You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using restrictions, the maxNumberOfFiles, allowedFileTypes, etc are useful because they validate on file add which happens before the upload button is pressed.
So in my onBeforeUpload check I am getting files that have only passed some of the restrictions. Instead, I think all of the restrictions should be validated before validating with the user's onBeforeUpload call.
The text was updated successfully, but these errors were encountered:
…Added and onBeforeUpload callbacks
Addresses #1545, but I’m not sure this is the right move. Is it better to check restrictions before or after the callbacks?
Hi! Thanks for your input. I’ve first tried to do what you suggested — validate everything before callbacks, and also pass the file file objects to the callback. But upon discussion we’ve realized that since we are past 1.0, this would be a breaking change, so we decided to only implement minor changes in #1726, and not touch the order in which restrictions are checked. We might revisit this for 2.0.
Thanks for looking into the behavior! Do you know if this is still on the roadmap for 2.0?
Alternatively could a different callback be included that runs after the validation steps but still before upload occurs? I'd like to leverage Uppy's normalization and filtering before adding some additional steps on top.
vymao
pushed a commit
to vymao/uppy
that referenced
this issue
Mar 29, 2022
…Added and onBeforeUpload callbacks
Addresses transloadit#1545, but I’m not sure this is the right move. Is it better to check restrictions before or after the callbacks?
When using restrictions, the maxNumberOfFiles, allowedFileTypes, etc are useful because they validate on file add which happens before the upload button is pressed.
However, the minNumberOfFiles restriction is validated in upload but after the onBeforeUpload check is called.
So in my onBeforeUpload check I am getting files that have only passed some of the restrictions. Instead, I think all of the restrictions should be validated before validating with the user's onBeforeUpload call.
The text was updated successfully, but these errors were encountered: