直接返回文件

导入make_response,send_file

response = make_response(send_file(filename))
response.headers["Content-Disposition"] = "attachment;filename="+filename+";"
return response