Skip to content
Snippets Groups Projects
download_file.py 455 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"])
    @bp.route("/choose_file", methods=["GET", "POST"])
    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'
        
        return send_file(path,
                        as_attachment=True)