非常简单的代码
@app.route('/download')
def download_file():
file_path = 'test.xlsx' # 服务器端的文件路径和文件名
return send_file(file_path, as_attachment=True)
非常简单的代码
@app.route('/download')
def download_file():
file_path = 'test.xlsx' # 服务器端的文件路径和文件名
return send_file(file_path, as_attachment=True)