Skip to main content

Module resumable

Module resumable 

Source
Expand description

Types shared by resumable upload clients and servers.

A resumable upload writes one object across multiple requests. The client first creates a session, declaring the object’s complete size with HEADER_UPLOAD_LENGTH. The server returns a CreateSessionResponse containing an opaque SessionToken that identifies the upload.

The client then sends chunks with HEADER_UPLOAD_OFFSET set to the byte position at which each chunk starts. If an upload is interrupted, the client can send the wildcard offset UploadOffset::Unknown to query the server’s authoritative position before resuming. The request that completes the upload returns a CompleteUploadResponse.

Session tokens contain the canonical object path and backend state protected by the storage service, and clients must treat their contents as opaque. The token bytes are encoded as unpadded base64url when the token is placed in a request’s session query parameter.

Structs§

CompleteUploadResponse
Response from the request that completes the upload.
CreateSessionResponse
Response from creating a resumable upload session.
InvalidSessionToken
Error returned for a non-canonical or malformed external session token.
InvalidUploadOffset
Error returned when an UploadOffset header value cannot be parsed.
SessionToken
Identifier for an in-progress resumable upload session.

Enums§

UploadOffset
The value of the HEADER_UPLOAD_OFFSET request header.
UploadProgress
How far a resumable upload has progressed.

Constants§

HEADER_UPLOAD_LENGTH
Request header declaring the total size of the object, in bytes.
HEADER_UPLOAD_OFFSET
Header carrying the byte offset of a chunk, or the offset the server holds.