Upload an Object to a Bucket

An object can be data in any format. You can upload it directly from your local system using a directory structure customizable per your requirement.

Note: When you upload an object, make sure its name is unique to its current path.

To upload an object or a group of objects:

  1. Click the Upload button and choose Upload Folder if you wish to upload an entire folder with all of its objects, or Upload File if you wish to upload a select group of objects or just one object.

    catalyst_stratus_upload_choice
  2. If you choose to upload:

Select the required folder from your local system and click Upload.

catalyst_startus_upload_folder

The folder will be uploaded with all its contents.

catalyst_stratus_upload_folder_action_complete

Click the uploaded directory to confirm it contains all the objects it contained in the local system.

catalyst_stratus_all_uploaded_folder_action

Select the file, or files from your local system to upload, and click Open.

catalyst_stratus_object_upload_file_inprog

The files will be uploaded.

catalyst_stratus_object_uploaded_console

Upload Object Using Path

You can also upload objects to the bucket using the Create Path option.

catalyst_stratus_create_path_button_highlit
Note: The path option is best used when you wish to store one or more objects in a particular path in the bucket. You can find out more about the path from this help documentation.
  1. Click the Create Path button.

    catalyst_stratus_showcase
  2. Provide your required path using the your required path using the forward slash ‘/’ special character as the directory separator.

    catalyst_stratus_slash_path_show
  3. Click the upload-icon and select the required object in your local system and click Open to upload.

    catalyst_stratus_object_upload_in_path_show

The entered path will be created and can be navigated in a manner you would a conventional directory.

catalyst_stratus_obj_created_in_path

The following SDK method enables you to upload an object to the bucket:

Note: Visit this help document for more information on this SDK method.

Ensure the following packages are imported:

    
copy

import com.zc.component.stratus.beans.ZCPutObjectOptions; import java.nio.file.Path; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.io.*;

    
copy

InputStream file =new FileInputStream(“filePath”); Boolean res = bucket.putObject(“objectName”, file); System.out.println(res);

Note: Visit this help document for more information on this SDK method.
    
copy

// create a read stream for upload the object const file = fs.createReadStream(“file_path”); // call the upload method const res = await bucket.putObject(“object_name”, file); console.log(res);

Note: Visit this help document for more information on this SDK method.
    
copy

file = open(‘file_path’,‘rb’) res = bucket.put_object(‘object_name’,file) print(res)

Note: Visit this help document for more information on this SDK method.
    
copy

const putObject = stratus.putObject("{object_name}","{File}", “{options}”, “{processCallback}”); const putObjectStart = putObject.start(); // to start the request const putObjectAbort = putObject.abort(); // to abort the request

Note: Visit this help document for more information on this SDK method.
    
copy

bucketInstance.upload( filePath : “{file_path}”, fileName : “{file_name}”, shouldCompress : true ) { error in if let error = error { print(“Error : ( error )”) return } print(“Uploaded Successfully”) }

Note: Visit this help document for more information on this SDK method.
    
copy

bucketIntance.uploadObject("/Desktop", “Helplinecard.jpeg”, true, { println(" » Object Upload Success -$it") }, { println(" » Object Upload Failed -$it") }, progress = { bytesWritten, contentLength, percentage -> println(“Percentage: $percentage”) } )

Note: Visit this help document for more information on this SDK method.
    
copy

try{ XFile? imageFile = await pickImage(ImageSource.gallery); var bucket = stratus.bucket(“testing”); var response = await bucket.uploadObject(imageFile!.path); print(“Upload Status: ${response.statusCode}”); } on ZCatalystException catch (ex) { print(ex.toString()); }

Note: Stratus constantly scans for malware in the background. When the scans encounter malware, the user, admin, super admin, and project owner will be notified of the malware, and the uploaded object is immediately and permanently deleted from the bucket.

Last Updated 2025-06-03 18:19:55 +0530 +0530