1

I am trying to upload the image on a localhost server using flask and I did it successfully but I want the metadata of that uploaded image like name, size, date and time of the image. Here is my code :

photos = UploadSet('photos', IMAGES)

app.config['UPLOADED_PHOTOS_DEST'] = 'static/img'
configure_uploads(app, photos)

@app.route('/upload', methods=['GET', 'POST'])
def upload():
    if request.method == 'POST' and 'photo' in request.files:
        img_file = photos.save(request.files['photo'])
        imageType = photos.save(img_file.content_type) # this is not 
                                                         working.
        return img_file
    return render_template('upload.html')


if __name__ == '__main__':
    app.debug=True
    app.run(host='0.0.0.0',port=5000)

How can I get the meta data of the image.

coder_247
  • 53
  • 7

0 Answers0