mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-15 20:31:03 +00:00
Web UI: Better handling of upload destination dir checks (#1076)
Web UI: Better handling of upload destination dir checks
This commit is contained in:
parent
538887b805
commit
8823dfba7d
@ -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)
|
||||
|
||||
|
||||
|
@ -253,6 +253,7 @@ def test_upload_file(http_client, delete_file):
|
||||
chunk_byte_offset = chunk_number * chunk_size
|
||||
|
||||
form_data = {
|
||||
"destination": "disk_images",
|
||||
"dzuuid": str(uuid.uuid4()),
|
||||
"dzchunkindex": chunk_number,
|
||||
"dzchunksize": chunk_size,
|
||||
|
Loading…
x
Reference in New Issue
Block a user