Skip to main content

sdk.file_2.showdownloadfile

Home > @matterway/sdk > File_2 > showDownloadFile

File_2.showDownloadFile() function

Shows a message to the user with a download button for the specified file.

Signature:

export declare function showDownloadFile(ctx: Context, options: ShowDownloadFileOptions): Promise<void>;

Parameters

ParameterTypeDescription
ctxContextThe Matterway SDK context.
optionsShowDownloadFileOptionsAdditional options for the message and download button.

Returns:

Promise<void>

Promise of void

Example

const file = { name: 'example.txt', data: 'SGVsbG8gV29ybGQh', type: 'text/plain' }; const downloadButton = 'Download Now'; const options = { file, downloadButton }; await showDownloadFile(context, options);