Appearance
Function: showFileDownload()
ts
function showFileDownload(ctx: Context, options: ShowFileDownloadOptions): Promise<void>;Defined in: src/file/offerMwFile.tsx:51
Experimental
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
options | ShowFileDownloadOptions | Options for the message and download button. |
Returns
Promise<void>
Resolves when the user dismisses the message.
Deprecated
Use showUI.fileDownload instead.
Show a message with a download button for a file.
Example
ts
const recipe = await mwFileFromDrive('/Documents/grandmas-cookies.pdf', 'application/pdf');
await showFileDownload(ctx, {
file: recipe,
downloadButton: 'Download Recipe',
title: 'Your recipe is ready!',
});