I have the following code to get the url of images stored in firebase storage.
const firebase = require('firebase');
require('firebase/storage');
firebase.initializeApp(conf);
const firebaseRef = firebase.storage().ref(path);
firebaseRef.getStorage().getDownloadURL().then(url => {
console.log(url);
}).catch(function (error) {
console.log(error);
});
When I try to run it (with a correct path) it always ends with the error:
FirebaseStorageError {
code_: 'storage/canceled',
message_: 'Firebase Storage: User canceled the upload/download.',
serverResponse_: null,
name_: 'FirebaseError'
}
I have this storage rules:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write
// : if request.auth != null;
}
}
}
When I try to upload or delete some file with the nodejs api it works great but at the momment to get the url of one file it always return the same error.
I tryed finding what could cause this but i can't find anything: https://firebase.google.com/docs/storage/web/handle-errors
And of course as a user im not canceling the upload/download stage.
Thank you in advance.