rules_version = '2';
// Craft rules based on data in your Firestore database
// allow write: if firestore.get(
// /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin;
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
// allow read, write: if
// request.auth != null;
// request.resource.size<2*1024*1024; //&&
// request.resource.contentType.matches('image/*');
// request.resource.size < 2*1024*1024 &&
// (!('contentType' in request.resource) || request.resource.contentType.matches('image/*'));
//request.resource.size<2*1024*1024 &&
//request.resource.contentType.matches('image/*');
}
}
}
It seems like that the only way to upload successfully image to the file storage is without any security conditions whatsoever…
as the owner: I don’t have the permission to access the file, The server understood the request, but will not fulfill it.
i am using npm i firebase
Thanks.
