I want to get the size of uploading image to control if it is greater than max file upload limit. I tried this one:
@app.route(\"/new/photo\",methods=[\"POST
As someone else already suggested, you should use the
app.config['MAX_CONTENT_LENGTH']
to restrict file sizes. But Since you specifically want to find out the image size, you can do:
import os photo_size = os.stat(request.files['post-photo']).st_size print photo_size