title: How to change downloading name in Flask?
body: <p>I'm using Flask's <code>send_file</code> to serve a file at a specific URL. However, the name of the saved file is always the last part of the URL, like <code>download</code>, instead of the real name <code>table.csv</code>. How can I return the file with the correct filename?</p>
  <pre class="lang-py prettyprint-override"><code>@app.route(&quot;/download&quot;)
  def download()
      return send_file(&quot;/path/to/table.csv&quot;)
  </code></pre>