I have an issue regarding the integration of downloaded photos from Firebase storage in my Flutter app.
I am using the https://pub.dev/packages/gallery_saver package to download the images to the device from the user. Due to a bug/the concept of the plugin you are only able to download images if the url ends with e.g. jpeg/png/jpg etc. Here some other comments of people who have the same issue withe the package: https://github.com/CarnegieTechnologies/gallery_saver/issues/66
To use the package with my app now I am adding the filename to the end of the image url. This works completely fine when my security rules allow all reads.
As soon as I add these rules:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read: if request.auth != null;
}
}
}
I get an error 403 forbidden on downloading all images. Is there a way to make this work while using file endings at the end of the url?
Download URLs generated by Firebase for Cloud Storage are opaque URLs, and you can't modify them.
Your options are to: