I am new to firebase storage. Can anyone tell me how to make the storage files public for reading and writing?. The default code provided by firebase is given below. What changes should I make ?
service firebase.storage { match /b/image-view-b1cf5.appspot.com/o { match /{allPaths=**} { allow read, write: if request.auth != null; } } }
Accessing Files Through References Although Firebase Storage uses a real-time database you can access data via a familiar file/folder system. When accessing files, you simply need to call the reference where your file is stored. References also enable you to control where files are stored and how files are labeled.
You can edit these rules by selecting a Firebase app in the Firebase console and viewing the Rules tab of the Storage section.
FYI: if you want public read only.
service firebase.storage { match /b/image-view-b1cf5.appspot.com/o { match /{allPaths=**} { allow read; allow write: if request.auth != null; } } }
The documentation explains that if no rule expression is provided, the rule evaluates to true:
service firebase.storage { match /b/image-view-b1cf5.appspot.com/o { match /{allPaths=**} { // Allow access by all users allow read, write; } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With