Delete a File
The delete() method is used to delete a file from the folder. The file used in the code snippet below is the file object.
The promise returned here will be resolved to an object in which the content key contains the deleted file details.
Copied//Delete the file by calling the method which returns a promise.
var filestore = catalyst.file;
var folder = filestore.folderId(FOLDER_ID);
var file = folder.fileId(FILE_ID);
var deletePromise = file.delete();
deletePromise
.then((response) => {
console.log(response.content);
})
.catch((err) => {
console.log(err);
});