Delete a File

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 that must be deleted by its unique File ID.

    
copy
Future<APIResponse> <FILE_INSTANCE>.delete()

A sample code snippet is shown below:

    
copy
ZCatalystFolder folder = ZCatalystApp.getInstance() .getFileStoreInstance() .getFolderInstance(2823000000006561); try{ var (_ file) = await folder.getFile(2823000000006561); await file.delete(); print('File deleted successfully.'); } on ZCatalystException catch (ex) { print(ex.toString()); }

Last Updated 2024-09-12 18:16:13 +0530 +0530