I have a question about flask werkzeug.filestorage
I wrote the code using flask
but I got a question
I use the code to get the image file data
request.files['file']
is the werkzeug.datastructures.FileStorageobject
request.files['file'].stream
works well.
Read file data without saving it in Flask
this question says, use like request.files['file'].read()
but it occur error
I want to know why it occur errors and the difference between above code and the example of the use.
This is my total code
from PIL import Image
app.route('/get_image', methods = ['POST'])
def image_check():
# i works well
img = Image.open(request.files['file'].stream)
# it occur error
# img = Image.open(request.files['file'].read())
logger.info("file {}".format(type(request.files['file'])))