Download a file from the folder
A file can be downloaded from the folder by referring to its unique File Id. A folder reference or a folder meta is used in the below code snippet. FileID is passed as an argument to the downloadFile() method.
The promise returned here will be resolved to a buffer containing the content of the file.
Copied//Download the file by passing the file ID to the method which in turn returns a promise
let filestore = app.filestore();
let folder = filestore.folder(1510000000109545);
let downloadPromise = folder.downloadFile(1510000000107568);
downloadPromise.then((fileObject) => {
console.log(fileObject);
});