1
0
Fork 0
mirror of synced 2024-07-01 20:50:49 +12:00

fix make chunk start from 1

This commit is contained in:
Damodar Lohani 2021-12-03 11:12:46 +05:45
parent e57030b45a
commit 307114f2c5

View file

@ -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;
}
}