This question already has an answer here:
-
FirebaseStorage: How to Delete Directory
6 answers
I can easily delete a file within a child reference, but how would I delete the entire folder from Firebase Storage?
let postRef = FIRStorage.storage().reference().child("posts/folderName")
postRef.deleteWithCompletion { (error) in
print(error)
}
Error file does not exists. Any ideas?
Long story short, we haven't implemented a recursive (or folder) delete. This topic is covered in another post: FirebaseStorage: How to Delete Directory
For now, we recommend storing a list of files in another source (like the Realtime Database) and deleting files as necessary. You can also perform this type of delete in the Firebase Console (console.firebase.google.com).
In the future, we may offer this sort of functionality, but don't have it fully spec'ed out.