How to get the meta data of an image upload to server using flask.
up vote
1
down vote
favorite
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.
python-3.x flask
add a comment |
up vote
1
down vote
favorite
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.
python-3.x flask
stackoverflow.com/questions/4764932/…
– roy
Nov 11 at 17:45
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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.
python-3.x flask
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.
python-3.x flask
python-3.x flask
asked Nov 11 at 11:10
coder_247
186
186
stackoverflow.com/questions/4764932/…
– roy
Nov 11 at 17:45
add a comment |
stackoverflow.com/questions/4764932/…
– roy
Nov 11 at 17:45
stackoverflow.com/questions/4764932/…
– roy
Nov 11 at 17:45
stackoverflow.com/questions/4764932/…
– roy
Nov 11 at 17:45
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248130%2fhow-to-get-the-meta-data-of-an-image-upload-to-server-using-flask%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
stackoverflow.com/questions/4764932/…
– roy
Nov 11 at 17:45