Calculates the correct values for sequentially reading a file for multipart upload. This method should
be used in conjunction with upload_part().
Access
public
Parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
Required |
The size in bytes of the entire file. |
|
|
|
Required |
The size in bytes of the part of the file to send. |
Returns
Type |
Description |
|---|---|
|
An array containing key-value pairs. The keys are |
Examples
Get the seek position and length values for a multipart upload.
define('MB', 1048576);
// Instantiate the class
$s3 = new AmazonS3();
$response = $s3->get_multipart_counts(125*MB, 40*MB);
// Success?
var_dump($response);
Result:
array(4) {
[0]=>
array(2) {
["seekTo"]=>
int(0)
["length"]=>
int(41943040)
}
[1]=>
array(2) {
["seekTo"]=>
int(41943040)
["length"]=>
int(41943040)
}
[2]=>
array(2) {
["seekTo"]=>
int(83886080)
["length"]=>
int(41943040)
}
[3]=>
array(2) {
["seekTo"]=>
int(125829120)
["length"]=>
int(5242880)
}
}
Source
Method defined in services/s3.class.php | Toggle source view (18 lines) | View on GitHub

