[Answered ]-Check size of multiple uploaded files

1👍

You use .getlist(…) [Django-doc] to obtain the list of files:

for image in request.FILES.getlist('images'):
    if image.size > settings.MAX_UPLOAD_SIZE:
        raise Exception(f'Image {images} is too large 3mb max')

Leave a comment