Skip to content

Instantly share code, notes, and snippets.

@pcote
Created March 16, 2017 19:00
Show Gist options
  • Save pcote/d96b46a2a734a3ff44419ec88fd5f47d to your computer and use it in GitHub Desktop.
Save pcote/d96b46a2a734a3ff44419ec88fd5f47d to your computer and use it in GitHub Desktop.
app.config["UPLOAD_FOLDER"] = "uploads"
@app.route("/sendfile", methods=["POST"])
def send_file():
fileob = request.files["file2upload"]
filename = secure_filename(fileob.filename)
save_path = "{}/{}".format(app.config["UPLOAD_FOLDER"], filename)
fileob.save(save_path)
return "successful_upload"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment