Skip to content

Commit d8aa69d

Browse files
committed
Fix segment name to support more than 9 parts
Zero-padding the segment number to 5 digits allows to support the minimum chunk size of 1MB and the maximum of 5GB. Without padding, when retrieving a file segmented in 10 or more segments, it will be reassembled in the wrong order and thus will be rendered useless.
1 parent 3ffee7b commit d8aa69d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/OpenCloud/ObjectStore/Upload/TransferPart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function getPath()
135135
*/
136136
public static function createRequest($part, $number, $client, $options)
137137
{
138-
$name = sprintf('%s/%s/%d', $options['objectName'], $options['prefix'], $number);
138+
$name = sprintf('%s/%s/%05d', $options['objectName'], $options['prefix'], $number);
139139
$url = clone $options['containerUrl'];
140140
$url->addPath($name);
141141

0 commit comments

Comments
 (0)