# Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class ResumableUploader (1.72.2)

1.72.2 (latest) 1.72.1 1.71.2 1.70.0 1.69.0 1.68.2 1.67.0 1.66.0 1.65.0 1.64.3 1.63.0 1.62.3 1.61.0 1.60.1 1.59.1 1.58.2 1.53.0 1.52.11 1.51.2 1.50.0 1.49.3 1.48.1 Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class ResumableUploader.

Resumable upload implementation.

## Namespace

Google \\ Cloud \\ Core \\ Upload

## Methods

### __construct

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `requestWrapper` | `https://docs.cloud.google.com/php/docs/reference/cloud-core/latest/RequestWrapper` |
| `data` | `string|resource|Psr\Http\Message\StreamInterface` |
| `uri` | `string` |
| `options` | `array` Optional configuration. |
| `↳ metadata` | `array` Metadata on the resource. |
| `↳ uploadProgressCallback` | `callable` The given callable function/method will be called after each successfully uploaded chunk. The callable function/method will receive the number of uploaded bytes after each uploaded chunk as a parameter to this callable. It's useful if you want to create a progress bar when using resumable upload type together with $chunkSize parameter. If $chunkSize is not set the callable function/method will be called only once after the successful file upload. |
| `↳ chunkSize` | `int` Size of the chunks to send incrementally during a resumable upload. Must be in multiples of 262144 bytes. |
| `↳ restOptions` | `array` HTTP client specific configuration options. |
| `↳ retries` | `int` Number of retries for a failed request. **Defaults to** `3`. |
| `↳ contentType` | `string` Content type of the resource. |

### getResumeUri

Gets the resume URI.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### resume

Resumes a download using the provided URI.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resumeUri` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` |   |

### upload

Triggers the upload process.

Errors are of form [`google.rpc.Status`](https://cloud.google.com/apis/design/errors#error_model),
and may be obtained via [Google\\Cloud\\Core\\Exception\\ServiceException::getMetadata()](https://docs.cloud.google.com/php/docs/reference/cloud-core/latest/Exception.ServiceException#_Google_Cloud_Core_Exception_ServiceException__getMetadata__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` |   |

### uploadAsync

Currently only the MultiPartUploader supports async.

Any calls to this will throw a generic Google Exception.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html` |   |