Web UI: Better handling of upload destination dir checks (#1076)

Web UI: Better handling of upload destination dir checks
This commit is contained in:
Daniel Markstedt
2023-01-26 18:10:33 -08:00
committed by GitHub
parent 538887b805
commit 8823dfba7d
2 changed files with 7 additions and 3 deletions
+6 -3
View File
@@ -980,11 +980,14 @@ def upload_file():
return make_response(auth["msg"], 403)
destination = request.form.get("destination")
if destination == "file_server":
destination_dir = FILE_SERVER_DIR
else:
if destination == "disk_images":
server_info = piscsi_cmd.get_server_info()
destination_dir = server_info["image_dir"]
elif destination == "shared_files":
destination_dir = FILE_SERVER_DIR
else:
return make_response(f"Invalid destination '{destination}'", 403)
return upload_with_dropzonejs(destination_dir)