Better handling of files

This commit is contained in:
Mylloon 2022-10-10 20:51:22 +02:00
parent c124d3cf04
commit cf548aaffa
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -7,9 +7,8 @@ router = Blueprint("upload", __name__)
@router.route("", methods=["POST"]) @router.route("", methods=["POST"])
def upload(): def upload():
if request.method == "POST": if request.method == "POST":
print(request.get_data()) if "file" in request.files:
data = request.form.get("file"); file = request.files["file"]
if data == None: print(file)
return redirect("index")
else: return redirect("index")
print("Data received!")