Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send multiple files with Flask?

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?

like image 625
henrry Avatar asked Mar 01 '26 10:03

henrry


1 Answers

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

like image 136
Yehor Smoliakov Avatar answered Mar 04 '26 00:03

Yehor Smoliakov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!