The download
method initiates the download of a file using the provided URL.
try {
const result = await sdk.file.download({
url: 'file_url_here', // The URL of the file to download.
name: 'downloaded_file', // Specify the desired file name.
});
if (result.success) {
console.log('Download initiated successfully.');
} else {
console.log('Failed to initiate the download.');
}
} catch (error) {
console.error(error.message);
}
Params
url
(string): The URL of the file to download.name
(string): Specify the desired file name for the downloaded file.
Required API Key Permission
Read File