@app.route('/uploads/<path:filename>')
def download_file(filename):
return send_from_directory(app.config['UPLOAD_FOLDER'],
filename, as_attachment=True)
参数说明
directory – the directory where all the files are stored.
filename – the filename relative to that directory to download.
options – optional keyword arguments that are directly forwarded to send_file().