Skip to content

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

ParameterTypeDescription
ctxContextContext object.
fileIdstringThe 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');

Matterway Assistant SDK Documentation