Flask download box

download, flask, html

Solution

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

Problem

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

Original source

Related problems