From 307114f2c5c41c2f9d421bcbd6ef152f24fd908a Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 3 Dec 2021 11:12:46 +0545 Subject: [PATCH] fix make chunk start from 1 --- app/controllers/api/storage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index bc3090d0f5..0313de1fc6 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -600,7 +600,7 @@ App::post('/v1/storage/buckets/:bucketId/files') } else { // Calculate total number of chunks based on the chunk size i.e ($rangeEnd - $rangeStart) $chunks = (int) ceil($size / ($end + 1 - $start)); - $chunk = (int) ($start / ($end + 1 - $start)); + $chunk = (int) ($start / ($end + 1 - $start)) + 1; } } @@ -629,7 +629,7 @@ App::post('/v1/storage/buckets/:bucketId/files') if (!$file->isEmpty()) { $chunks = $file->getAttribute('chunksTotal', 1); if ($chunk == -1) { - $chunk = $chunks - 1; + $chunk = $chunks; } }