使用Flask发送多个文件?

2024-09-30 02:21:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我有将单个文件发送到用户端的代码:

客户端:

@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 )

但我想发送多个文件发送到用户端。我该怎么办


Tags: 文件代码用户imageapp客户端attachmentget

热门问题