Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove validation support #397

Closed
jelhan opened this issue Sep 11, 2020 · 2 comments · Fixed by #578
Closed

Remove validation support #397

jelhan opened this issue Sep 11, 2020 · 2 comments · Fixed by #578

Comments

@jelhan
Copy link
Collaborator

jelhan commented Sep 11, 2020

Ember File Upload currently supports validation of files per mime type and extension. But this feature has some bugs and unexpected behaviors:

  • <FileUpload> may allow a file to be uploaded, which fails validation rules enforced by <FileInput>.
    On <FileUpload> it only sets accept HTML attribute. It does not validate if the given file matches the validation after it's selected. Some browser allow the user to ignore the accept list.
    <FileDropzone> validates all files and blocks upload if not passing accept criteria.
  • Due to browser limitations validation of files provided to <FileDropzone> via drag and drop happens too late.
  • Provided validation is inflexible if multiple files are given, out of which some are valid and some are invalid.
  • It misses advanced validation features like resetting validation state.

Due to this reasons I propose that we drop that feature. Instead we should provide APIs to plugin validation by consumers.

Previous discussions can be found in #127 and #376

As this would be a fundamental change affecting capabilities of this addon I would like to have great consent before moving forward.

@lukemelia
Copy link
Contributor

As the author of #127, I support this change, provided that there is a documented upgrade path.

@gilest
Copy link
Collaborator

gilest commented Sep 13, 2020

@jelhan I agree that we should drop this feature

@gilest gilest mentioned this issue Sep 26, 2021
22 tasks
gilest added a commit that referenced this issue Oct 26, 2021
…578)

Adds `@onSelect` callback arg to FileUpload. Implementers may optionally return a list of filtered files from this callback to validate user selection.
Modifies `@onDrop` callback arg in FileDropzone. Implementers may optionally return a list of filtered files from this callback to validate user selection.

Fixes #397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants