Любая помощь, пожалуйста! я получаю сообщение об ошибке при попытке загрузить файл с AngularFireStorage Даже если я уже идентифицирован в приложении с аутентификацией firebase
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}
Моя функция загрузки
upload(event){
this.ImgError = "";
const id = event.target.files[0].name;
this.ref = this.afStorage.ref(id);
var ImgType = event.target.files[0].type.split('/')[0];
if(ImgType !== 'image') {
this.ImgError = "Désolé, invalide image";
return;
}
if(event.target.files[0]){
this.imagePath = '../../../assets/img/loading.gif';
this.ref.put(event.target.files[0])
.then(snapshot => {
return snapshot.ref.getDownloadURL(); // Will return a promise with the download link
})
.then(downloadURL => {
this.imagePath = downloadURL;
return downloadURL;
})
.catch(error => {
this.ImgError = "Une Erreur lors de la téléchargement de l'image";
});
}
}
Ошибка, которую я получаю
{
"error": {
"code": 403,
"message": "Permission denied. Could not perform this operation"
}
}