Answers for "how to upload image file in flask"

2

how to put a image in flask

<image src="{{url_for('static',filename = 'images/download.jpg')}}" >
Posted by: Guest on January-14-2021
0

flask rest api upload image

from flask import Flask
    from flask_restful import Resource, Api, reqparse
    import werkzeug

    class UploadAudio(Resource):
      def post(self):
        parse = reqparse.RequestParser()
        parse.add_argument('file', type=werkzeug.datastructures.FileStorage, location='files')
        args = parse.parse_args()
        audioFile = args['file']
        audioFile.save("your_file_name.jpg")
Posted by: Guest on June-02-2020

Code answers related to "how to upload image file in flask"

Python Answers by Framework

Browse Popular Code Answers by Language