Delete a File

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 delete an existing file from a folder in the File Store by calling the delete() method and referring to the file with the file instance. This will delete the file permanently.

The <FILE_INSTANCE> used in the code below is an instance created for the specific file, as shown in the sample code snippet. This will refer to the file from the specific folder that must be deleted by its unique File ID.

    
copy
<FILE_INSTANCE>.delete(
success: () → Unit,
failure: ((ZCatalystException) → Unit)?
): ZCatalystRequest<Unit>?

A sample code snippet is shown below:

    
copy
ZCatalystApp.getInstance().getFileStoreInstance().getFolderInstance(2823000000006544).getFile(2823000000006589, //Replace this with your Folder ID and File ID
{
file -> file.delete(
{
println("File Deleted successfully")
})
},
{
exception -> println("Delete File Failed $exception")
})

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

ON THIS PAGE
ACCESS THIS PAGE