0

I tried this:

methods: {
    async deleteCard(mediaRef) {
      // mediaRef is equal to reference of the images folder
      await this.$fire.storage.ref('albums_cards').child(mediaRef).delete()
    },
  },

error:

Firebase Storage: Object 'albums_cards/88b8f000-6dd0-11ed-9c2d-afa013ab0c4b' does not exist. (storage/object-not-found)

but as you see in the picture it exists. I think the method which I used is to delete specific file, but I want to delete folder.

Is there any way to do it?

enter image description here

1 Answers1

1

Currently firebase doesn’t support deleting directories and it is a known issue. You can only delete individual files. So, it's best to store a reference to those files and remove them one by one.

As mentioned here Firebase Storage does not work with folders. Folders actually don't exist, only files. You can upload files to a specific location/path but their entire filesystem is closer to a flat hash table where you store path/file pairs, than to a file system with multiple folder levels.

You can check the following links for deleting files individually: link1, link2 and link3

Roopa M
  • 2,171
  • 4
  • 12