download

Download a file.

Parameters

fileId: string

The identifier of the file to download.

chunkSize?: number

Size of each download chunk in bytes.

offset?: number

Download offset in bytes.

Result

AsyncGenerator<Uint8Array, void, unknown>

Syntax

// Required parameters only.
await client.download(fileId);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.download(fileId, { chunkSize, offset });

Examples

for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
  await outFile.write(chunk);
}