Skip to content

Function: downloadFile()

ts
function downloadFile(ctx: Context, file: SdkFile): Promise<void>;

Defined in: src/file/offerFile.tsx:93

Parameters

ParameterTypeDescription
ctxContextThe Matterway SDK context.
fileSdkFileThe SdkFile object containing the file data and metadata to be downloaded.

Returns

Promise<void>

Promise of void

Deprecated

Downloads a file by creating a temporary link element with the given file data and metadata and then simulating a click event to trigger a download.

Example

ts
const file = { name: 'example.txt', data: 'SGVsbG8gV29ybGQh', type: 'text/plain' };
await downloadFile(context, file);

Matterway Assistant SDK Documentation