Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class ResumableUploader (1.60.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 Google\Cloud\Core\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, and may be obtained via 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
GuzzleHttp\Promise\PromiseInterface