-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Formidable V2 Filter issue #941
Labels
Comments
Behaves like Array.filter: Returning false will simply ignore the file and go to the next. use form.emit('error') inside filter to make form.parse error (formData.emit('error') in your case) |
I also recommend you to slugify ext as it is user input and may contain invalid characters
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support plan
Context
What are you trying to achieve or the steps to reproduce?
When I attached a file as png or another type. The formidable filter option returns false. In this false case formidable.parse() method does not give the form error invalid file type. variable formError always return null or undefined even if filter is false.
What was the result you got?
formData.parse(req, (fromError, fields, files) => {})
fromError always return null or undefined even if formData filter option returns false.
What result did you expect?
fromError returns a valid file type filter error.
The text was updated successfully, but these errors were encountered: