-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issue with multiple file validation #393
Comments
I'm having the same issue, any work around? |
I think you can create your own field and validation by copy the code from PR #338. |
I will try to implement what David recommended late this month as an alternative to #338. |
Closed
This comment was marked as off-topic.
This comment was marked as off-topic.
3 tasks
We really need this feature in flask wtforms, Any updates as to potentially when this could be updated please? |
Fix released in v1.2.0 |
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Hey, I'm having trouble with validating a
wtforms.MultipleFileField
field.Creating a form field like so:
not_important = wtforms.MultipleFileField("Multiple file test",[FileRequired("File required"), FileAllowed(['csv'], ".csv file required")])
doesn't really work. After passing one or more files to the respective field, the validation returns "File required" error.But the multi-dict of
request.files
shows that all files are read correctly.Sample:
ImmutableMultiDict([('not_important', <FileStorage: 'Headline_all_test.csv' ('application/vnd.ms-excel')>)]
So basically the issue is - flask requests reads files passed, but the
form.validate_on_submit()
errors out telling me, that no file has been passed.BTW - found this fresh SO thread pertaining to the same issue: https://stackoverflow.com/questions/59734277/filerequiredvalidator-doesnt-work-when-using-multiplefilefield-in-my-form
The text was updated successfully, but these errors were encountered: