I cannot find a function like 'getReferenceFromUrl' on the web Firebase. I have stored a reference to the URL (and not the name of the image) for each item in my database.
Is there any workaround to get the reference on the image with the URL?
Yep, it's in the docs, maybe a little hidden.
// Create a reference to the file to delete
var desertRef = firebase.storage().refFromURL('https://firebasestorage.googleapis.com...')
// Delete the file
desertRef.delete().then(function() {
// File deleted successfully
}).catch(function(error) {
// Uh-oh, an error occurred!
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With