Answer the question
In order to leave comments, you need to log in
Why do I get this field is required error when uploading files (Flask, WTForms)?
Actually, the point is in the title. I'm trying to make a form for creating/editing a post with two images. When I try to submit the form, the validation for both FileFields fails with the wording "This field is required", although I selected the files. What am I doing wrong? Enctype for the form specified. Everything is started on the local server.
Code on pastebin
Answer the question
In order to leave comments, you need to log in
Apparently the FileRequired validator does not support python3 well, since I did not observe such a problem in 2.7. I wrote my custom validator, as soon as I have free time I will try to deal with the problem and fix the native one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question