class Google_Http_MediaFileUpload (View source)

Manage large file uploads, which may be media but can be any type of sizable data.

Constants

UPLOAD_MEDIA_TYPE

UPLOAD_MULTIPART_TYPE

UPLOAD_RESUMABLE_TYPE

Methods

__construct(Google_Client $client, RequestInterface $request, string $mimeType, string $data, bool $resumable = false, bool $chunkSize = false)

No description

setFileSize($size)

Set the size of the file that is being uploaded.

int
getProgress()

Return the progress on the upload

nextChunk(bool $chunk = false)

Send the next part of the file to upload.

int
getHttpResultCode()

Return the HTTP result code from the last call made.

resume($resumeUri)

Resume a previously unfinished upload

string
getUploadType($meta)

Valid upload types:

  • resumable (UPLOAD_RESUMABLE_TYPE)
  • media (UPLOAD_MEDIA_TYPE)
  • multipart (UPLOAD_MULTIPART_TYPE)

getResumeUri()

No description

setChunkSize($chunkSize)

No description

getRequest()

No description

Details

__construct(Google_Client $client, RequestInterface $request, string $mimeType, string $data, bool $resumable = false, bool $chunkSize = false)

No description

Parameters

Google_Client $client
RequestInterface $request
string $mimeType
string $data

The bytes you want to upload.

bool $resumable
bool $chunkSize

File will be uploaded in chunks of this many bytes. only used if resumable=True

setFileSize($size)

Set the size of the file that is being uploaded.

Parameters

$size
  • int file size in bytes

int getProgress()

Return the progress on the upload

Return Value

int

progress in bytes uploaded.

nextChunk(bool $chunk = false)

Send the next part of the file to upload.

Parameters

bool $chunk

Optional. The next set of bytes to send. If false will use $data passed at construct time.

int getHttpResultCode()

Return the HTTP result code from the last call made.

Return Value

int code

resume($resumeUri)

Resume a previously unfinished upload

Parameters

$resumeUri

the resume-URI of the unfinished, resumable upload.

string getUploadType($meta)

Valid upload types:

  • resumable (UPLOAD_RESUMABLE_TYPE)
  • media (UPLOAD_MEDIA_TYPE)
  • multipart (UPLOAD_MULTIPART_TYPE)

Parameters

$meta

Return Value

string

getResumeUri()

No description

setChunkSize($chunkSize)

No description

Parameters

$chunkSize

getRequest()

No description