Upload a File in a 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.

You can upload a file from your local system to an existing folder in the File Store, by referring to the folder’s unique ID. You can upload an image, text document, CSV, or any type of file you need. The maximum size of a file that you can upload is 100 MB.

You must create a file object for the file to be uploaded and create a File Store instance, as shown below. You must then fetch the folder details by passing its Folder ID in getFolderInstance(), and upload the file object to the folder instance using the uploadFile() method.

A unique File ID is created for the file after it is uploaded.

Note : Catalyst provides 1 GB of File Store space for each project in the development environment. There are no upper limits for storage in the production environment.

Ensure the following packages are imported:

    
copy
import com.zc.component.files.ZCFile; import com.zc.component.files.ZCFolder; import java.io.File;
    
copy
// Create a file object File f = new File("empdetails.csv"); //Create an instance for the File Store ZCFile fileStore = ZCFile.getInstance(); //Get a folder instance using the Folder ID ZCFolder folder = fileStore.getFolderInstance(1510000000109393); //Upload the file using the folder instance folder.uploadFile(f);

Last Updated 2025-02-24 14:38:44 +0530 +0530

ON THIS PAGE
ACCESS THIS PAGE