from werkzeug.utils import secure_filename
@app.route('/route', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
f = request.files['the_file']
f.save(tmp_path + secure_filename(f.filename))
Flask secure upload
Library: flask
Shortcut: flask.upload.secure
0 Comments
Add Comment
Log in to add a comment