Firebase retention rule to prevent overwriting

I don't want the user to be able to upload a new file that already exists with the same name in the repository,

Here's what I've tried but still get 403

when uploading a non-ex file.

service firebase.storage {
  match /b/projectid/o {
    match /{allPaths=**} {
      allow read;
      allow write: if !resource || request.resource.name == resource.name;
    }
  }
}

      

+3


source to share


1 answer


i was in the same situation and i changed the filename using uid + timestamp.png on the client side



0


source







All Articles