Documentation

AbstractUploadBuilder
in package

AbstractYes

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

$headers

protected array<string|int, mixed> $headers = array()

Array of headers to set on the object

Methods

newInstance()

Return a new instance of the UploadBuilder

public static newInstance() : static
Return values
static

resumeFrom()

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
$this

setHeaders()

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
$this

setSource()

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
throws
InvalidArgumentException

when the source cannot be found or opened

Return values
$this

        
On this page

Search results