$fn.download(file, filename)
Download the specified file locally. The name of the file to be downloaded, can be specified. "asynchronous"
Arguments
Name | Type | Description |
---|---|---|
file | Buffer | Buffer object of the file to download |
filename | string | File name to download |
Return value
None
Sample
try { const file = await $fn.getFile('/note.json'); const buffer = file.data; // File Download await $fn.download(buffer, 'download.json');} catch (err) { console.log("Error", err);}