firebase-storage

Firebase Storage: Using Download Url Instead of Storage Ref

谁说我不能喝 提交于 2020-05-15 04:59:20
问题 I have an iOS app that uses Firebase Storage for storing images. After an image is uploaded I save its storage reference in my Firebase Database . When the app loads, it fetches various storage references from the database and uses the FirebaseUI method to display their corresponding images like so: let storageRef = Storage.storage().reference(forURL: imageUrl) imageView.sd_setImage(with: storageRef, placeholderImage: nil) This works great... but its very slow. While looking for solutions to

How to get the uid of the authenticated Firebase user in a Cloud Functions storage trigger

做~自己de王妃 提交于 2020-05-14 10:25:13
问题 Background: I'm using Firebase Cloud Functions, the new Firestore Database, and storage bucket with an Android client. What I want to accomplish: When a user uploads a picture to a storage bucket, I want to use cloud functions to get the file path/link to the image location in the storage bucket and store this string as a new document under a new collection called "pictures" under the currently logged in user's document in Firestore. That way, I can see the images each user has uploaded

How to get the uid of the authenticated Firebase user in a Cloud Functions storage trigger

夙愿已清 提交于 2020-05-14 10:22:48
问题 Background: I'm using Firebase Cloud Functions, the new Firestore Database, and storage bucket with an Android client. What I want to accomplish: When a user uploads a picture to a storage bucket, I want to use cloud functions to get the file path/link to the image location in the storage bucket and store this string as a new document under a new collection called "pictures" under the currently logged in user's document in Firestore. That way, I can see the images each user has uploaded

Prevent HTML file input from selecting files in Google Drive while using Android's native file chooser

浪子不回头ぞ 提交于 2020-05-13 02:04:50
问题 Currently I'm working on a page that allows users to upload a file to Firebase Storage. When opening the site through Google Chrome on Android and selecting a file for upload from a standard HTML file input, it uses Android's native file chooser. In most cases, a user would choose a file stored locally on the device, but the file chooser also shows their Google Drive files and a user currently isn't prevented from selecting one of those files. The file is returned as a File object in

Need help understanding the Firebase Storage CDN

主宰稳场 提交于 2020-05-12 11:00:45
问题 I'm building an audiobook app and have uploaded the audio files on Firebase Storage. My problem is that I experience different performances in San Francisco vs Toronto. I am under the impression that Firebase Storage has built-in CDN. if so, Do I need to enable it somewhere? if not, how do I add GCP CDN to my Firebase Storage files behind Firebase Auth?? Checking the domain storage.googleapis.com which is where my Firebase Storage files are hosted shows that it is using the Google CDN. Here

Firebase Cloud Storage download url vs path

懵懂的女人 提交于 2020-05-12 02:24:11
问题 I'm new to firebase storage and wants to know what is the best practice. I want to upload image to firebase cloud storage and was returned a download url which I then stored to firestore. Is the download url permanent? Other users will read from the firestore to get the url to download the image. But when I want to delete the image from CloudStorage, I only have the download url but not the file path. So do I delete it ? If I store the file path instead, how to get the download url ? 回答1: Is

Getting 403 Forbidden error when trying to load image from Firebase Storage

假如想象 提交于 2020-05-10 14:49:17
问题 I'm using firebase storage to store and load images for users on my android app. All users must be authenticated before using it. Occasionally, some user profile images are not showing and throwing "403 Forbidden" error. Those images were displaying before, I'm not sure why they stop working. i'm using the following rules on my firebase storage: service firebase.storage { match /b/<storage_address>.appspot.com/o { match /{allPaths=**} { allow read: if request.auth != null; allow write: if

Getting 403 Forbidden error when trying to load image from Firebase Storage

懵懂的女人 提交于 2020-05-10 14:48:07
问题 I'm using firebase storage to store and load images for users on my android app. All users must be authenticated before using it. Occasionally, some user profile images are not showing and throwing "403 Forbidden" error. Those images were displaying before, I'm not sure why they stop working. i'm using the following rules on my firebase storage: service firebase.storage { match /b/<storage_address>.appspot.com/o { match /{allPaths=**} { allow read: if request.auth != null; allow write: if

How to Download Data like image or file via URL(firebase-file-path) using Firebase Storage in flutter?

99封情书 提交于 2020-04-30 08:45:46
问题 From the firebase documentation I found this getReferenceUrl(url) method. I use this gs://app_id.appspot.com/users/0a7d99409c.jpg as parameter inside getReferenceUrl method. /// Creates a [StorageReference] given a gs:// or // URL pointing to a Firebase /// Storage location. Future<StorageReference> getReferenceFromUrl(String fullUrl) async { .... .. } } Use-Case: I upload the file in the storage and save the file location for future use. And when I have to download the file in future how can

Cloud Functions: Resized images not loading

99封情书 提交于 2020-04-26 06:11:10
问题 I am following a tutorial to resize images via Cloud Functions on upload and am experiencing two major issues which I can't figure out: 1) If a PNG is uploaded, it generates the correctly sized thumbnails, but the preview of them won't load in Firestorage (Loading spinner shows indefinitely). It only shows the image after I click on "Generate new access token" (none of the generated thumbnails have an access token initially). 2) If a JPEG or any other format is uploaded, the MIME type shows