From 1169f210315ca1d398b53830a30f3121316e5567 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 21 Jan 2025 10:42:13 -0600 Subject: If the target file exists, return true for all its chunk checks. --- uploader/files/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'uploader/files') diff --git a/uploader/files/views.py b/uploader/files/views.py index 7e2ef0b..cd0c188 100644 --- a/uploader/files/views.py +++ b/uploader/files/views.py @@ -26,6 +26,14 @@ def resumable_upload_get(): "statuscode": 400 }), 400 + # If the complete target file exists, return 200 for all chunks. + if target_file(fileid).exists(): + return jsonify({ + "chunk": chunk, + "message": "The complete file already exists.", + "statuscode": 200 + }), 200 + if Path(chunks_directory(fileid), chunk_name(filename, chunk)).exists(): return jsonify({ -- cgit v1.2.3