我正在尝试制作一个显示“另存为”下载框的按钮。我想提供下载的图像不在静态文件夹中,也不在。使用flask.send_file
通过在浏览器中打开文件来工作。
如何在不提交页面的情况下(不更改当前页面)使用send.file
来启动下载框?
答案 0 :(得分:3)
查看as_attachment
中的send_file
选项:
http://flask.pocoo.org/docs/api/#flask.send_file
这是一个有点相关的问题:
Content-Disposition:What are the differences between "inline" and "attachment"?