0

the documentation is a little bit old and I can't find any useful information.

I been trying this with no result (I'm using Reactjs):

import { getStorage } from 'firebase/storage';
import { initializeApp } from 'firebase/app'

const firebaseConfig = initializeApp({
  apiKey: '### FIREBASE API KEY ###',
  authDomain: '### FIREBASE AUTH DOMAIN ###',
  projectId: '### CLOUD FIRESTORE PROJECT ID ###'
  ...etc...
});

const store = getStorage(firebaseConfig)
const storeRef = ref(store, `post/${id}`)
await deleteObject(storeRef)

the folder structure is: /post/${id}/...files...

  • Please post full code where you have tried this or debug output – Ashish Nov 30 '21 at 12:07
  • ok, it's almost the same – jpbluesman Nov 30 '21 at 12:18
  • 4
    Mass delete operations are not available in the Web SDK for security reasons. You would have to use [`list`](https://firebase.google.com/docs/reference/js/storage.md#list) and then delete each object one-by-one using [`deleteObject`](https://firebase.google.com/docs/reference/js/storage.md#deleteobject). If you want to be able to perform a mass deletion, consider delegating the task to a [Callable Cloud Function](https://firebase.google.com/docs/functions/callable). Both strategies can be found [under this question](https://stackoverflow.com/a/60998445/3068190). – samthecodingman Nov 30 '21 at 12:20
  • Posted an answer for firebase 9 https://stackoverflow.com/a/70169560/6310260 – Mises Nov 30 '21 at 13:07
  • ok, thanks to all – jpbluesman Nov 30 '21 at 14:00

0 Answers0