Skip to content
Snippets Groups Projects
download_file.py 448 B
Newer Older
  • Learn to ignore specific revisions
  • Mia Wang's avatar
    Mia Wang committed
    from flask import Blueprint, request, render_template, flash, send_file
    
    bp = Blueprint("download_file", __name__)
    
    @bp.route("/download_file", methods=["GET"])
    
    Mia Wang's avatar
    Mia Wang committed
    @bp.route("/download", methods=["GET", "POST"])
    
    Mia Wang's avatar
    Mia Wang committed
    def download():    
        # Setup for the 'return send_file()' function call at the end of this function
        path = 'templates/CNN.zip' # e.g. 'templates/download.markdown'
    
    Mia Wang's avatar
    Mia Wang committed
    
    
    Mia Wang's avatar
    Mia Wang committed
        return send_file(path,
                        as_attachment=True)