from flask
import send_file
from flask
import make_response
,send_from_directory
,current_app
import os
from urllib
.parse
import quote
@app
.route
('/download',methods
=['GET','POST'])
def download():
UPLOAD_FOLDER
= ''
ROOT_FOLDER
= os
.path
.join
(os
.getcwd
(), UPLOAD_FOLDER
)
filename
=''
response
= make_response
(send_file
(ROOT_FOLDER
+ filename
))
response
.headers
["Content-Disposition"] = "attachment; filename={}".format(quote
(filename
))
return response
转载请注明原文地址: https://win8.8miu.com/read-759.html