Home > Net >  i am getting Permission denied error when i upload image on firebase
i am getting Permission denied error when i upload image on firebase

Time:02-01

I am working on Firebase image upload. but facing an error in my rules of storage.

       rules_version = '2';
       service firebase.storage {
      match /b/savephoto-a1cc3.appspot.com/o {
        match /{allPaths=**} {
  // Allow access by all users
  allow read, write;
    }
}
  }

CodePudding user response:

Since you say that you have already implemented Firebase Authentication, then the following rules will do the trick:

service firebase.storage {
  match /b/{bucket}/o {
    match /{files} {
      allow read, write: if request.auth != null;
    }
  }
}

If you want to have data validation as well, please check the official documentation:

  •  Tags:  
  • Related