AbstractUploadBuilder
in package
Easily create a multipart uploader used to quickly and reliably upload a large file or data stream to Amazon S3 using multipart uploads
Table of Contents
Properties
- $client : AwsClientInterface
- $headers : array<string|int, mixed>
- $source : EntityBody
- $state : TransferStateInterface
Methods
- build() : TransferInterface
- Build the appropriate uploader based on the builder options
- newInstance() : static
- Return a new instance of the UploadBuilder
- resumeFrom() : $this
- Set the state of the upload. This is useful for resuming from a previously started multipart upload.
- setClient() : $this
- Set the client used to connect to the AWS service
- setHeaders() : $this
- Specify the headers to set on the upload
- setSource() : $this
- Set the data source of the transfer
- initiateMultipartUpload() : TransferStateInterface
- Initiate the multipart upload
Properties
$client
protected
AwsClientInterface
$client
Client used to transfer requests
$headers
protected
array<string|int, mixed>
$headers
= array()
Array of headers to set on the object
$source
protected
EntityBody
$source
Source of the data
$state
protected
TransferStateInterface
$state
State of the transfer
Methods
build()
Build the appropriate uploader based on the builder options
public
abstract build() : TransferInterface
Return values
TransferInterfacenewInstance()
Return a new instance of the UploadBuilder
public
static newInstance() : static
Return values
staticresumeFrom()
Set the state of the upload. This is useful for resuming from a previously started multipart upload.
public
resumeFrom(TransferStateInterface|string $state) : $this
You must use a local file stream as the data source if you wish to resume from a previous upload.
Parameters
- $state : TransferStateInterface|string
-
Pass a TransferStateInterface object or the ID of the initiated multipart upload. When an ID is passed, the builder will create a state object using the data from a ListParts API response.
Return values
$thissetClient()
Set the client used to connect to the AWS service
public
setClient(AwsClientInterface $client) : $this
Parameters
- $client : AwsClientInterface
-
Client to use
Return values
$thissetHeaders()
Specify the headers to set on the upload
public
setHeaders(array<string|int, mixed> $headers) : $this
Parameters
- $headers : array<string|int, mixed>
-
Headers to add to the uploaded object
Return values
$thissetSource()
Set the data source of the transfer
public
setSource(resource|string|EntityBody $source) : $this
Parameters
- $source : resource|string|EntityBody
-
Source of the transfer. Pass a string to transfer from a file on disk. You can also stream from a resource returned from fopen or a Guzzle EntityBody object.
Tags
Return values
$thisinitiateMultipartUpload()
Initiate the multipart upload
protected
abstract initiateMultipartUpload() : TransferStateInterface