What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-30 20:54:03
Flask Download a File
from flask import Flask from flask import send_file app = Flask(__name__) @app.route('/download') def downloadFile (): #For windows you need to use drive name [ex: F:/Example.pdf] path = "/Examples.pdf" return send_file(path, as_att... Add solution -
Python 2021-09-29 05:25:04
how to receive request in flask
import flask app = flask.Flask('your_flask_env') @app.route('/register', methods=['GET', 'POST']) def register(): if flask.request.method == 'POST': username = flask.request.values.get('user') # Your form's password = flask.request.va... Add solution -
Javascript 2021-09-19 23:56:02
flask server js return from folder
from flask import Flask, request, send_from_directory # set the project root directory as the static folder, you can set others. app = Flask(__name__, static_url_path='') @app.route('/js/<path:path>') def send_js(path): return send_from_direct... Add solution -
Python 2021-09-19 01:59:02
flask request.files save zip
@app.route("/upload", methods=["GET", "POST"]) def upload(): if request.method == "GET": return render_template("upload.html") obj = request.files.get("file") print(obj) # &l... Add solution -
Python 2021-09-16 05:35:02
python simple web app
# Core web app using flask # Download flask if you haven't from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' if __name__ == '__main__': app.run() # If you want to put this on the internet, u... Add solution