Class MultipartUploader
- Aws\Multipart\AbstractUploadManager implements GuzzleHttp\Promise\PromisorInterface
-
Aws\Multipart\AbstractUploader
-
Aws\S3\MultipartUploader uses Aws\S3\MultipartUploadingTrait
- Namespace: Aws\S3
- Located at S3/MultipartUploader.php
Encapsulates the execution of a multipart upload to S3 or Glacier.
Direct known subclasses
Aws\S3\Crypto\S3EncryptionMultipartUploader
,
Aws\S3\Crypto\S3EncryptionMultipartUploaderV2
Methods Summary
-
__construct ( Aws\S3\S3ClientInterface $client, mixed $source, array $config = [] )
Creates a multipart upload for an S3 object.
Methods inherited from Aws\Multipart\AbstractUploadManager
getState()
,
promise()
,
upload()
Methods used from Aws\S3\MultipartUploadingTrait
Methods Details
__construct (
Aws\S3\S3ClientInterface
$client,
mixed
$source,
array
$config = []
)
Creates a multipart upload for an S3 object.
The valid configuration options are as follows:
- acl: (string) ACL to set on the object being upload. Objects are private by default.
- before_complete: (callable) Callback to invoke before the
CompleteMultipartUpload
operation. The callback should have a function signature likefunction (Aws\Command $command) {...}
. - before_initiate: (callable) Callback to invoke before the
CreateMultipartUpload
operation. The callback should have a function signature likefunction (Aws\Command $command) {...}
. - before_upload: (callable) Callback to invoke before any
UploadPart
operations. The callback should have a function signature likefunction (Aws\Command $command) {...}
. - bucket: (string, required) Name of the bucket to which the object is being uploaded, or an S3 access point ARN.
- concurrency: (int, default=int(5)) Maximum number of concurrent
UploadPart
operations allowed during the multipart upload. - key: (string, required) Key to use for the object being uploaded.
- params: (array) An array of key/value parameters that will be applied to each of the sub-commands run by the uploader as a base. Auto-calculated options will override these parameters. If you need more granularity over parameters to each sub-command, use the before_* options detailed above to update the commands directly.
- part_size: (int, default=int(5242880)) Part size, in bytes, to use when doing a multipart upload. This must between 5 MB and 5 GB, inclusive.
- prepare_data_source: (callable) Callback to invoke before starting the multipart upload workflow. The callback should have a function signature like
function () {...}
. - state: (Aws\Multipart\UploadState) An object that represents the state of the multipart upload and that is used to resume a previous upload. When this option is provided, the
bucket
,key
, andpart_size
options are ignored.
Parameters
Aws\S3\S3ClientInterface |
$client | Client used for the upload. |
mixed | $source | Source of the data to upload. |
array | $config = [] | Configuration used to perform the upload. |
Overrides
Aws\Multipart\AbstractUploader::__construct
Constants summary
integer |
PART_MIN_SIZE
|
#
5242880
|
integer |
PART_MAX_SIZE
|
#
5368709120
|
integer |
PART_MAX_NUM
|
#
10000
|
Constants inherited from Aws\Multipart\AbstractUploadManager
DEFAULT_CONCURRENCY