downloadChunk
Download a chunk of a file. CACHE [F]
Parameters
fileId: string
The identifier of a file.
chunkSize?: number
Size of each download chunk in bytes.
offset?: number
Download offset in bytes.
signal?: AbortSignal
Download abort signal.
fileInformation?: string
Additional file information. Required for secret chat files.
Result
The downloaded chunk.
Syntax
// Required parameters only.
await client.downloadChunk(fileId);
// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.downloadChunk(fileId, {
chunkSize,
offset,
signal,
fileInformation,
});
Examples
const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });