Download a File from the Folder

Unlike other SDKs, Catalyst Web SDK allows you to get the download URL of a file where the actual file can be downloaded. It requires the folder ID and file ID to identify which file is to be downloaded from the URL. The file used in the code snippet below is the file object. The getDownloadLink() method is used to return the promise.

Note : The promise returned here will be resolved to an object in which the content key contains a download_url key where the download URL will be available.
//Get the download Link by calling the method which returns a promise. var filestore = catalyst.file; var folder = filestore.folderId(FOLDER_ID); var file = folder.fileId(FILE_ID); var downloadPromise = file.getDownloadLink(); downloadPromise .then((response) => { console.log(response.content); }) .catch((err) => { console.log(err); });

Last Updated 2023-11-14 13:20:49 +0530 +0530