Answers for "flask return image on get request"

1

how to get images on flask page

<img src="{{url_for('static', filename='MD.png')}}">
Posted by: Guest on July-16-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language