aboutsummaryrefslogtreecommitdiff
path: root/uploader/files
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-01-21 10:42:13 -0600
committerFrederick Muriuki Muriithi2025-01-21 10:42:13 -0600
commit1169f210315ca1d398b53830a30f3121316e5567 (patch)
treef6471f8f009794c76ae3761725224e0bc84c7ba6 /uploader/files
parent7ec1495babe6be6f0ac1c89e3b79fc6a703bf369 (diff)
downloadgn-uploader-1169f210315ca1d398b53830a30f3121316e5567.tar.gz
If the target file exists, return true for all its chunk checks.
Diffstat (limited to 'uploader/files')
-rw-r--r--uploader/files/views.py8
1 files changed, 8 insertions, 0 deletions
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({