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)?

Mihai Neacsu
  • 2,045
  • 5
  • 23
  • 37

1 Answers1

4

Look into the as_attachment option in send_file:

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

Here's a somewhat related question:

Content-Disposition:What are the differences between "inline" and "attachment"?

Community
  • 1
  • 1
ubik
  • 4,440
  • 2
  • 23
  • 29