Reputation: 23
I’m using android studio with firebase, Is there a way to delete multiple images at a time from firebase storage for android
Upvotes: 2
Views: 3159
Reputation: 121
In one of my project I used below code to delete multiple files
const imageURLS = !Array.isArray(item?.data?.imageURL)
? [item?.data?.imageURL]
: item?.data?.imageURL;
imageURLS.forEach(async (URL) => {
let storageRef = projectStorage.refFromURL(URL);
await deleteFile(`images/${currentUser.uid}/${storageRef.name}`);
});
Upvotes: 1
Reputation: 317427
There is no API for bulk or batch deleting files in Cloud Storage. You will have to delete each one individually as described in the documentation.
Upvotes: 3