Appearance
Function: fetchFileChunks()
ts
function fetchFileChunks(ctx: Context, fileId: string): Promise<ArrayBuffer>;Defined in: src/file/getMwFile.tsx:40
Fetch file data in chunks from the page context and reassemble into an ArrayBuffer.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
fileId | string | The unique identifier of the chunked file. |
Returns
Promise<ArrayBuffer>
The reassembled ArrayBuffer.
Example
ts
const photoBuffer = await fetchFileChunks(ctx, 'vacation-photo-001');
console.log('Reassembled', photoBuffer.byteLength, 'bytes of sunshine');