Answer the question
In order to leave comments, you need to log in
What validator is needed to check type and size in MultipleFileField?
I'm making a form to upload multiple images at once.
I don't know which validator to check if the selected files are images,
and also if they are larger than a certain size.
from flask_wtf import FlaskForm
from wtforms import SubmitField, MultipleFileField
from wtforms.validators import Required
class UploadImagesForm(FlaskForm):
images = MultipleFileField('Upload images', validators=[Required()])
submit = SubmitField('Upload')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question