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

# Class UploadBuilder

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

  Aws\Common\Model\MultipartUpload\AbstractUploadBuilder
  Aws\S3\Model\MultipartUpload\UploadBuilder

Namespace: Aws\S3\Model\MultipartUpload
Located at Aws/S3/Model/MultipartUpload/UploadBuilder.php

## Methods summary

- `public` `setBucket ( string $bucket )`

  Set the bucket to upload the object to

- `public` `setKey ( string $key )`

  Set the key of the object

- `public` `setMinPartSize ( int $minSize )`

  Set the minimum acceptable part size

- `public` `setConcurrency ( int $concurrency )`

  Set the concurrency level to use when uploading parts. This affects how many parts are uploaded in parallel. You must use a local file as your data source when using a concurrency greater than 1

- `public` `setMd5 ( string $md5 )`

  Explicitly set the MD5 hash of the entire body

- `public` `calculateMd5 ( bool $calculateMd5 )`

  Set to true to have the builder calculate the MD5 hash of the entire data source before initiating a multipart upload (this could be an expensive operation). This setting can ony be used with seekable data sources.

- `public` `calculatePartMd5 ( bool $usePartMd5 )`

  Specify whether or not to calculate the MD5 hash of each uploaded part. This setting defaults to true.

- `public` `setAcp ( Aws\S3\Model\Acp $acp )`

  Set the ACP to use on the object

- `public` `setOption ( string $name, string $value )`

  Set an option to pass to the initial CreateMultipartUpload operation

- `public` `addOptions ( array $options )`

  Add an array of options to pass to the initial CreateMultipartUpload operation

- `public` `setTransferOptions ( array $options )`

  Set an array of transfer options to apply to the upload transfer object

- `public` `build ( )`

  Build the appropriate uploader based on the builder options

- `protected` `initiateMultipartUpload ( )`

  Initiate the multipart upload

## Methods detail

# `public mixed`
`setBucket( string $bucket )`

Set the bucket to upload the object to

#### Parameters

$bucket
  `string`
  $bucket Name of the bucket

#### Returns

`mixed`
$this
# `public mixed`
`setKey( string $key )`

Set the key of the object

#### Parameters

$key
  `string`
  $key Key of the object to upload

#### Returns

`mixed`
$this
# `public mixed`
`setMinPartSize( integer $minSize )`

Set the minimum acceptable part size

#### Parameters

$minSize
  `integer`
  $minSize Minimum acceptable part size in bytes

#### Returns

`mixed`
$this
# `public mixed`
`setConcurrency( integer $concurrency )`

Set the concurrency level to use when uploading parts. This affects how many parts are uploaded in parallel. You must use a local file as your data source when using a concurrency greater than 1

#### Parameters

$concurrency
  `integer`
  $concurrency Concurrency level

#### Returns

`mixed`
$this
# `public mixed`
`setMd5( string $md5 )`

Explicitly set the MD5 hash of the entire body

#### Parameters

$md5
  `string`
  $md5 MD5 hash of the entire body

#### Returns

`mixed`
$this
# `public mixed`
`calculateMd5( boolean $calculateMd5 )`

Set to true to have the builder calculate the MD5 hash of the entire data source before initiating a multipart upload (this could be an expensive operation). This setting can ony be used with seekable data sources.

#### Parameters

$calculateMd5
  `boolean`
  $calculateMd5 Set to true to calculate the MD5 hash of the body

#### Returns

`mixed`
$this
# `public mixed`
`calculatePartMd5( boolean $usePartMd5 )`

Specify whether or not to calculate the MD5 hash of each uploaded part. This setting defaults to true.

#### Parameters

$usePartMd5
  `boolean`
  $usePartMd5 Set to true to calculate the MD5 has of each part

#### Returns

`mixed`
$this
# `public mixed`
`setAcp( `Aws\S3\Model\Acp` $acp )`

Set the ACP to use on the object

#### Parameters

$acp
  ``Aws\S3\Model\Acp``
  $acp ACP to set on the object

#### Returns

`mixed`
$this
# `public mixed`
`setOption( string $name, string $value )`

Set an option to pass to the initial CreateMultipartUpload operation

#### Parameters

$name
  `string`
  $name Option name
$value
  `string`
  $value Option value

#### Returns

`mixed`
$this
# `public mixed`
`addOptions( array $options )`

Add an array of options to pass to the initial CreateMultipartUpload operation

#### Parameters

$options
  `array`
  $options Array of CreateMultipartUpload operation parameters

#### Returns

`mixed`
$this
# `public mixed`
`setTransferOptions( array $options )`

Set an array of transfer options to apply to the upload transfer object

#### Parameters

$options
  `array`
  $options Transfer options

#### Returns

`mixed`
$this
# `public TransferInterface`
`build( )`

Build the appropriate uploader based on the builder options

#### Returns

`TransferInterface`

#### Throws

``Aws\Common\Exception\InvalidArgumentException``
when attempting to resume a transfer using a non-seekable stream
``Aws\Common\Exception\InvalidArgumentException``
when missing required properties (bucket, key, client, source)
# `protected TransferStateInterface`
`initiateMultipartUpload( )`

Initiate the multipart upload

#### Returns

`TransferStateInterface`

### Methods inherited from Aws\Common\Model\MultipartUpload\AbstractUploadBuilder

`newInstance()`, `resumeFrom()`, `setClient()`, `setHeaders()`, `setSource()`

### Magic methods summary

## Properties summary

`protected integer` | $concurrency | # Concurrency level to transfer the parts
`protected integer` | $minPartSize | # Minimum part size to upload
`protected string` | $md5 | # MD5 hash of the entire body to transfer
`protected boolean` | $calculateEntireMd5 | # Whether or not to calculate the entire MD5 hash of the object
`protected boolean` | $calculatePartMd5 | # Whether or not to calculate MD5 hash of each part
`protected array` | $commandOptions | # Array of initiate command options
`protected array` | $transferOptions | # Array of transfer options

### Properties inherited from Aws\Common\Model\MultipartUpload\AbstractUploadBuilder

`$client`, `$headers`, `$source`, `$state`