Skip to content

$fn.download(file, filename)

Download the specified file locally. The name of the file to be downloaded, can be specified. "asynchronous"

Arguments

NameTypeDescription
fileBufferBuffer object of the file to download
filenamestringFile 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);
}