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
I want to add support for maxFileSize, maxFiles, and maxUploadSize. Each time a file is added, it is first validated against these limits (if they are passed in as options) and marked as valid or invalid. Invalid files would not be uploaded but would still fire an event to let the user know they were added to the queue.
I was thinking a revalidate method could be added to Resumable and calling it would loop through the invalid files and update their validation status. Any files that are updated from invalid to valid would automatically be included for upload (e.g. if a valid file is removed, we may want to revalidate so that an invalid file which exceeded the maxFiles limit would now be valid and included in the upload).
I've toyed around with several possible implementation and wanted to see what your thoughts were before submitting a pull request.
The text was updated successfully, but these errors were encountered:
I was also considering adding an option which would allow the user to specify an external validation function (e.g. for possible server side validation).
My quick thoughts on maxFiles are on #17 and #25 -- and #25 was just merged in.
I think maxFiles can be handled as a special case, because we might want to clear the multiple option in the file input when the value is set to 1. For any other kind of validation/verification (whether total upload sizes, file type, names, or even reading of the files) I like your idea of having a callback. I would implement it by sending an array of file objects to the function -- which in turn would manipulate that data and return an array of the files to be included in the request. So basically and filter.
I want to add support for maxFileSize, maxFiles, and maxUploadSize. Each time a file is added, it is first validated against these limits (if they are passed in as options) and marked as valid or invalid. Invalid files would not be uploaded but would still fire an event to let the user know they were added to the queue.
I was thinking a revalidate method could be added to Resumable and calling it would loop through the invalid files and update their validation status. Any files that are updated from invalid to valid would automatically be included for upload (e.g. if a valid file is removed, we may want to revalidate so that an invalid file which exceeded the maxFiles limit would now be valid and included in the upload).
I've toyed around with several possible implementation and wanted to see what your thoughts were before submitting a pull request.
The text was updated successfully, but these errors were encountered: