chethan kumar
chethan kumar

Reputation: 23

How to delete multiple images from firebase storage at a time in android studio

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

Answers (2)

shiblee saidul
shiblee saidul

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

Doug Stevenson
Doug Stevenson

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

Related Questions