3

I have this code for sending a single file to the user side:

Server side:

@app.route('/image', methods = ['GET','POST'])
def image():
    # CU.close()
    SqlPicPlace="SELECT ImgData  FROM  tablename WHERE ImgSaveID=2"
    CU.execute(SqlPicPlace)
    ans=CU.fetchone()
    imgBinary = ans[0]    
    return send_file(io.BytesIO(imgBinary), attachment_filename='a.jpg', mimetype='image/jpg', as_attachment=True)

But I want to send more than 1 file to the user side. How can I do this?

henrry
  • 486
  • 6
  • 25

1 Answers1

2

HTTP does not support this functionality, but you can zip your files into an archive and send it to a user.

Yehor Smoliakov
  • 326
  • 3
  • 13