Skip to content Skip to sidebar Skip to footer

Uploading An Image To Flask Server

I am struggling bit with Flask and uploading a file, here is my Flask code so far: @app.route('/api/user/update/', methods=['PUT']) @auth.login_required def update_user():

Solution 1:

I think you should write file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) instead of filename.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)). The file is a File Storage object. And the filename is only a str.


Post a Comment for "Uploading An Image To Flask Server"