SDK for PHP V3

MultipartCopy extends AbstractUploadManager
in package
Uses MultipartUploadingTrait

Table of Contents

Methods

__construct()  : mixed
Creates a multipart upload for copying an S3 object.
copy()  : mixed
An alias of the self::upload method.
getStateFromService()  : UploadState
Creates an UploadState object for a multipart upload by querying the service for the specified upload's information.

Methods

__construct()

Creates a multipart upload for copying an S3 object.

public __construct(S3ClientInterface $client, string|array<string|int, mixed> $source[, array<string|int, mixed> $config = [] ]) : mixed

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 like function (Aws\Command $command) {...}.
  • before_initiate: (callable) Callback to invoke before the CreateMultipartUpload operation. The callback should have a function signature like function (Aws\Command $command) {...}.
  • before_upload: (callable) Callback to invoke before UploadPartCopy operations. The callback should have a function signature like function (Aws\Command $command) {...}.
  • bucket: (string, required) Name of the bucket to which the object is being uploaded.
  • 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.
  • 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, and part_size options are ignored.
  • metadata_directive: (string, default='COPY') Specifies whether to copy source object metadata to the destination. Set to 'COPY' to automatically forward metadata fields (Metadata, CacheControl, ContentDisposition, ContentEncoding, ContentLanguage, ContentType, Expires) from the source object. When set to 'COPY', source metadata takes precedence and any matching fields provided in 'params' are ignored. Set to 'REPLACE' to suppress automatic metadata copying and use your own values via the 'params' option.
  • source_metadata: (Aws\ResultInterface) The result of a HeadObject call on the copy source. If not provided, the SDK makes a HeadObject request to obtain the source object's size and metadata. Providing this avoids the extra request.
  • display_progress: (boolean) Set true to track status in 1/8th increments for upload.
Parameters
$client : S3ClientInterface

Client used for the upload.

$source : string|array<string|int, mixed>

Location of the data to be copied (in the form //). If the key contains a '?' character, instead pass an array of source_key, source_bucket, and source_version_id.

$config : array<string|int, mixed> = []

Configuration used to perform the upload.

copy()

An alias of the self::upload method.

public copy() : mixed
Tags
see
self::upload

getStateFromService()

Creates an UploadState object for a multipart upload by querying the service for the specified upload's information.

public static getStateFromService(S3ClientInterface $client, string $bucket, string $key, string $uploadId) : UploadState
Parameters
$client : S3ClientInterface

S3Client used for the upload.

$bucket : string

Bucket for the multipart upload.

$key : string

Object key for the multipart upload.

$uploadId : string

Upload ID for the multipart upload.

Return values
UploadState
<-- modeled_exceptions -->
On this page