ChunkUploadSession
final class ChunkUploadSession (View source)
Carries immutable metadata for one active sequential upload assembled in temporary storage.
Its offsets and expiry describe the trusted server-side state rather than client-supplied progress.
Methods
Creates a validated snapshot whose declared size and current offset cannot exceed the profile limit.
Returns the unguessable identifier used to locate and lock this temporary session.
Returns whether the session will complete through the generic file or image upload pipeline.
Returns the configured upload profile whose policy governs completion.
Returns the client filename retained for the existing extension validation boundary.
Returns the total byte count the client declared before any payload was accepted.
Returns the profile maximum captured when this session was started.
Returns the next byte offset required from a sequential append request.
Returns the server-counted number of chunks durably appended to this session.
Returns the chunk-count ceiling captured when the session reserved its quota.
Returns the private random token that makes completion retries target one stable filename.
Returns the UNIX timestamp at which the session was created.
Returns the fixed UNIX timestamp after which the session must not accept more data.
Returns application-owned opaque metadata persisted with this session.
Reports whether the supplied UNIX timestamp is at or beyond this session's fixed expiry.
Returns a new metadata snapshot after a fully persisted append advances the byte offset.
Details
__construct
__construct(string $uploadId, string $kind, string $profile, string $originalFilename, int $declaredSize, int $maxBytes, int $currentOffset, int $createdAt, int $expiresAt, array $context = [], int $chunkCount = 0, int $maxChunks = ChunkUploadConfig::DEFAULT_MAX_CHUNKS_PER_SESSION, string $publicationToken = '')
Creates a validated snapshot whose declared size and current offset cannot exceed the profile limit.
uploadId
string
uploadId()
Returns the unguessable identifier used to locate and lock this temporary session.
kind
string
kind()
Returns whether the session will complete through the generic file or image upload pipeline.
profile
string
profile()
Returns the configured upload profile whose policy governs completion.
originalFilename
string
originalFilename()
Returns the client filename retained for the existing extension validation boundary.
declaredSize
int
declaredSize()
Returns the total byte count the client declared before any payload was accepted.
maxBytes
int
maxBytes()
Returns the profile maximum captured when this session was started.
currentOffset
int
currentOffset()
Returns the next byte offset required from a sequential append request.
chunkCount
int
chunkCount()
Returns the server-counted number of chunks durably appended to this session.
maxChunks
int
maxChunks()
Returns the chunk-count ceiling captured when the session reserved its quota.
publicationToken
string
publicationToken()
Returns the private random token that makes completion retries target one stable filename.
createdAt
int
createdAt()
Returns the UNIX timestamp at which the session was created.
expiresAt
int
expiresAt()
Returns the fixed UNIX timestamp after which the session must not accept more data.
context
array
context()
Returns application-owned opaque metadata persisted with this session.
isExpired
bool
isExpired(int $now)
Reports whether the supplied UNIX timestamp is at or beyond this session's fixed expiry.
withAppendedChunk
ChunkUploadSession
withAppendedChunk(int $currentOffset)
Returns a new metadata snapshot after a fully persisted append advances the byte offset.