Fix: chunk upload handling for single chunk uploads

This commit is contained in:
Damodar Lohani
2026-02-09 02:54:40 +00:00
parent bae7b92dd9
commit 3c78f78ea9
@@ -256,6 +256,12 @@ class Create extends Action
if ($uploaded === $chunks) {
throw new Exception(Exception::STORAGE_FILE_ALREADY_EXISTS);
}
} else {
// Guard against manually setting range header for single chunk upload
if ($chunks === -1) {
$chunks = 1;
$chunk = 1;
}
}
$chunksUploaded = $deviceForFiles->upload($fileTmpName, $path, $chunk, $chunks, $metadata);