Better handling of files
This commit is contained in:
parent
c124d3cf04
commit
cf548aaffa
1 changed files with 5 additions and 6 deletions
|
@ -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!")
|
|
||||||
|
|
Reference in a new issue