Download a File from the Folder

Note: Catalyst now offers you a brand new object storage component called Stratus in Early Access mode. This component is a significant upgrade to the current Cloud Scale File Store component. You can find out more about the Stratus component here.

To use the Stratus component in the Early Access mode, email us at support@zohocatalyst.com.

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.
    
copy
//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 2025-02-24 14:38:44 +0530 +0530

ON THIS PAGE
ACCESS THIS PAGE