NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class AbstractUploadBuilder

Easily create a multipart uploader used to quickly and reliably upload a large file or data stream to Amazon S3 using multipart uploads

### Direct known subclasses

`Aws\Glacier\Model\MultipartUpload\UploadBuilder`, `Aws\S3\Model\MultipartUpload\UploadBuilder`

Abstract
Namespace: Aws\Common\Model\MultipartUpload
Located at Aws/Common/Model/MultipartUpload/AbstractUploadBuilder.php

## Methods summary

- `public static` `newInstance ( )`

  Return a new instance of the UploadBuilder

- `public` `setClient ( Aws\Common\Client\AwsClientInterface $client )`

  Set the client used to connect to the AWS service

- `public` `resumeFrom ( TransferStateInterface|string $state )`

  Set the state of the upload. This is useful for resuming from a previously started multipart upload. You must use a local file stream as the data source if you wish to resume from a previous upload.

- `public` `setSource ( resource|string|EntityBody $source )`

  Set the data source of the transfer

- `public` `setHeaders ( array $headers )`

  Specify the headers to set on the upload

- `abstract public` `build ( )`

  Build the appropriate uploader based on the builder options

- `abstract protected` `initiateMultipartUpload ( )`

  Initiate the multipart upload

## Methods detail

# `public static static`
`newInstance( )`

Return a new instance of the UploadBuilder

#### Returns

`static`
# `public mixed`
`setClient( `Aws\Common\Client\AwsClientInterface` $client )`

Set the client used to connect to the AWS service

#### Parameters

$client
  ``Aws\Common\Client\AwsClientInterface``
  $client Client to use

#### Returns

`mixed`
$this
# `public mixed`
`resumeFrom( `Aws\Common\Model\MultipartUpload\TransferStateInterface`|string $state )`

Set the state of the upload. This is useful for resuming from a previously started multipart upload. You must use a local file stream as the data source if you wish to resume from a previous upload.

#### Parameters

$state
  ``Aws\Common\Model\MultipartUpload\TransferStateInterface`|string`
  $state 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.

#### Returns

`mixed`
$this
# `public mixed`
`setSource( resource|string|`Guzzle\Http\EntityBody` $source )`

Set the data source of the transfer

#### Parameters

$source
  `resource|string|`Guzzle\Http\EntityBody``
  $source 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 `Guzzle\Http\EntityBody` object.

#### Returns

`mixed`
$this

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
when the source cannot be found or opened
# `public mixed`
`setHeaders( array $headers )`

Specify the headers to set on the upload

#### Parameters

$headers
  `array`
  $headers Headers to add to the uploaded object

#### Returns

`mixed`
$this
# `abstract public `Aws\Common\Model\MultipartUpload\TransferInterface``
`build( )`

Build the appropriate uploader based on the builder options

#### Returns

``Aws\Common\Model\MultipartUpload\TransferInterface``
# `abstract protected `Aws\Common\Model\MultipartUpload\TransferStateInterface``
`initiateMultipartUpload( )`

Initiate the multipart upload

#### Returns

``Aws\Common\Model\MultipartUpload\TransferStateInterface``

### Magic methods summary

## Properties summary

`protected `Aws\Common\Client\AwsClientInterface`` | $client | # Client used to transfer requests
`protected `Aws\Common\Model\MultipartUpload\TransferStateInterface`` | $state | # State of the transfer
`protected `Guzzle\Http\EntityBody`` | $source | # Source of the data
`protected array` | $headers | # Array of headers to set on the object