Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase 3 Storage don't allow file updating/overwriting

Is there a method/ruleset for Firebase 3 storage to disable file updating or overwriting?

I found data.exists() for Database but no solution for Storage.

like image 919
EralpB Avatar asked Aug 17 '16 11:08

EralpB


1 Answers

TL;DR: In Storage Security Rules, request.resource ~= newData.val() and resource ~= data.val(), so you can use them similarly.

service firebase.storage {
  match /b/<bucket>/o {
    match /path/to/file {
      allow write: if resource == null; // if !data.exists() in DB land
    }
  }
}
like image 108
Mike McDonald Avatar answered Oct 07 '22 09:10

Mike McDonald