3

I'm trying to make a button that will show the "Save as" download box. The images that I want to offer for download are not in the static folder, nor they will be. Using flask.send_file works by opening the file in the browser.

How can I use send.file in order to bring the download box up, without submitting the page (without changing the current page)?

4

1 回答 1

4

查看中的as_attachment选项send_file

http://flask.pocoo.org/docs/api/#flask.send_file

这是一个有点相关的问题:

Content-Disposition:“内联”和“附件”有什么区别?

于 2013-04-21T16:17:58.770 回答