Im trying to delete a folder in firebase storage, not just a file. im using react-native-firebase v5.
my directory structure looks something like this:
attachments
|__user-id
|__session-id
|__image1.png
|__image2.png
my delete operation looks like:
firebase
.storage()
.ref(`archived-attachments/${uid}/${sessionId}/`)
.delete()
.then(() => {
// do more stuff
})
.catch(err => dispatch({ type: types.UPDATE_FAIL, info: err.message }))
also tried:
firebase
.storage()
.ref(`archived-attachments`)
.child(uid)
.child(sessionId)
.delete()
.then(() => {
// do more stuff
})
.catch(err => dispatch({ type: types.UPDATE_FAIL, info: err.message }))
ive confirmed through logs that the uid & sessionId are correct and directly replicate the correct path to the folder i want deleted.
problem is an error is returned that says:
No object exists at the desired reference
Anyone have a solution for this? im trying to avoid creating a cloud function that uses @google-cloud/storage
to do this.
question from:
https://stackoverflow.com/questions/65929399/how-to-use-react-native-firebase-to-delete-a-whole-directory-in-firebase-storage 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…