Download an Object From a Bucket
To download an object from the bucket:
-
Click or select the required object.
-
Click Download.
-
Click Save in your system prompt.
The object will be downloaded to your local system.
You can also download the object using the Download button present in the object details view.

Ensure the following packages are imported
copy
import com.zc.component.stratus.beans.ZCGetObjectOptions; import java.nio.file.Path; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.io.*;
copy
InputStream dataStream = bucket.getObject(“objectName”); // download the object to your local machine Path path = Path.of(“file_path”); // specify a path to store the downloaded object Files.copy(dataStream, path, StandardCopyOption.REPLACE_EXISTING);
copy
const res = await bucket.getObject(“objectName”); // download the object to local machine const files = fs.createWriteStream(‘filePath’); res.on(‘data’, (data) => { files.write(data) });
copy
res = bucket.get_object(‘object_name’) # download the object to local machine file = open(‘file_path’,‘wb’) file.write(res)
copy
objectInstance.download(fromCache : true) { result in switch result { case.success(let url): do { let data = Data(contentsOf : url) DispatchQueue.main.sync { self.imageView.image = UIImage(date : data) } } catch { print("Error : \( error )") } case.error(let error): print("Error : \( error )") } }
copy
bucketInstance.getObject("SunSet.jpeg", "2823000000044005", //Replace this with your Folder ID and File ID { object->object.download({println("File download success ${it.available()}")}, {println("File download failed $it")})
copy
try { ZCatalystBucket bucket = stratus.bucket("testing"); var(response, object) = await bucket.getObject("SunSet.jpeg"); final downloadsDir = await getExternalStorageDirectory(); final filePath = downloadsDir !.absolute.path; var fileResponse = await object.download( pathToDownload : filePath, onProgress : (bytesWritten, contentLength, percentage) { print("Downloaded Percentage: $percentage"); }, ); print("Download Status: ${fileResponse.statusCode}"); OpenFile.open(filePath + '/SunSet.jpeg'); } on ZCatalystException catch (ex) { print(ex.toString()); }
Last Updated 2025-06-03 18:19:55 +0530 +0530
Yes
No
Send your feedback to us