Flask secure upload

    0

    1

    Python Flask

    Library: flask

    Shortcut: flask.upload.secure

    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))
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.