Appearance
Function: fileDownload()
ts
function fileDownload(ctx: Context, file: MwFile): Promise<void>;Defined in: src/file/offerMwFile.tsx:114
Experimental
Trigger a browser download for an MwFile.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
file | MwFile | The MwFile to download. |
Returns
Promise<void>
Resolves when the download starts.
Example
ts
const playlist = await mwFileFromDrive('/Music/summer-playlist.m3u', 'audio/x-mpegurl');
await fileDownload(ctx, playlist);
console.log('Downloading', playlist.name);