0

I want to delete all files from "user_id1" directory. Is it possible in Java? Or delete the directory "user_id1".

I have a firebase storage path that looks like this.

FirebaseStorage.getInstance().getReference("DP").child("user_id1");

1 Answers1

1

actually its not possible to delete whole path only way is to iterate over all files and perform delete operation.

G group ref: https://groups.google.com/g/firebase-talk/c/aG7GSR7kVtw

JS example:

   const storageRef = firebase.storage().ref('temp');
  storageRef.listAll().then((listResults) => {
    const promises = listResults.items.map((item) => {
      return item.delete();
    });
    Promise.all(promises);
  });

Try Same in Kotlin/JAVA.