April 2018
Intermediate to advanced
284 pages
6h 43m
English
To delete a file, you first need to get a reference to the file, the same as we saw in upload and download. Once you get a reference, you can call a delete() method on it to delete a file. It returns a promise that either resolves in case of success or rejects in case of an error.
Consider this example:
// Create a reference to the file to deletevar fileRef = storageRef.child('folder/file.jpg');// Delete the filedesertRef.delete().then(function() { // File deleted successfully}).catch(function(error) { // an error occurred!});
Now, let's see what is Google App Engine.