firebase-storage

How do I dynamically create a Firebase Storage reference based on previous reference value?

删除回忆录丶 提交于 2020-07-16 10:43:28
问题 Here's a brief overview of the process that I need help with: Client uploads images to Firebase Storage at users/displayName/uid/ - this step is clear and done. No help needed on this one. Then, client presses "request a quote" button which saves the URLs of the images (the ones that were uploaded to Storage in step 1) to Firebase Firestore - this step is clear and done. No help needed on this one. After the URLs are saved to the Firestore, I want those images from Step 1 to be moved within

How to enable “Share publicly” when uploading a file to Firebase storage?

两盒软妹~` 提交于 2020-07-15 07:40:35
问题 Firebase Storage uses Google Cloud Platform for storage. GCP allows the option "Share publicly" on files to be able to view such files in a browser. Here is the GCP documentation on this topic. Here you can see the option available via the GUI on the GCP console. Is it possible to enable the public option when uploading a file via Firebase? Edit: I've enabled public reading on the whole bucket although it's not ideal. gsutil defacl ch -u allUsers:R gs://<bucket> 回答1: With Firebase Storage,

How to enable “Share publicly” when uploading a file to Firebase storage?

╄→гoц情女王★ 提交于 2020-07-15 07:39:05
问题 Firebase Storage uses Google Cloud Platform for storage. GCP allows the option "Share publicly" on files to be able to view such files in a browser. Here is the GCP documentation on this topic. Here you can see the option available via the GUI on the GCP console. Is it possible to enable the public option when uploading a file via Firebase? Edit: I've enabled public reading on the whole bucket although it's not ideal. gsutil defacl ch -u allUsers:R gs://<bucket> 回答1: With Firebase Storage,

Image from Cloud Storage is not redendring in .map list

别等时光非礼了梦想. 提交于 2020-07-13 15:44:03
问题 I am making a list of posts in a .map fetching from my Firebase Cloud Firestore. I also have photos connecting to each post, and I fetch them by using the post.title + '.jpg' from Cloud Storage. The post title is fetching great, but when using the fetchImage it is not showing in the post. It is showing in the console.log. I can also access the url from the console, so nothing wrong there. Any ideas? {this.state.posts.map((post, i) => { let fetchImage firebase .storage() .ref(post.title + '

Image from Cloud Storage is not redendring in .map list

蹲街弑〆低调 提交于 2020-07-13 15:41:02
问题 I am making a list of posts in a .map fetching from my Firebase Cloud Firestore. I also have photos connecting to each post, and I fetch them by using the post.title + '.jpg' from Cloud Storage. The post title is fetching great, but when using the fetchImage it is not showing in the post. It is showing in the console.log. I can also access the url from the console, so nothing wrong there. Any ideas? {this.state.posts.map((post, i) => { let fetchImage firebase .storage() .ref(post.title + '

Firebase Storage Admin Error:400 Invalid Bucket Name

六月ゝ 毕业季﹏ 提交于 2020-07-10 11:43:23
问题 I'm trying to use firebase functions to do maintenance of my database and storage. Basically remove some old entries from one ref/bucket to another after they expire. The database part works great. However, the storage part, not so much. Here's how I initialize everything in my code: var functions = require('firebase-functions'); var admin = require("firebase-admin"); var serviceAccount = require('./my-app-bla-bla.json'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount)

Firebase Storage Admin Error:400 Invalid Bucket Name

喜欢而已 提交于 2020-07-10 11:42:49
问题 I'm trying to use firebase functions to do maintenance of my database and storage. Basically remove some old entries from one ref/bucket to another after they expire. The database part works great. However, the storage part, not so much. Here's how I initialize everything in my code: var functions = require('firebase-functions'); var admin = require("firebase-admin"); var serviceAccount = require('./my-app-bla-bla.json'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount)

Upload to firebase: TypeError: uploadTask.on is not a function

末鹿安然 提交于 2020-07-10 08:55:09
问题 I am doing a react POC for upload image to firebase. I have followed the firebase documentation Also referred to this blog post from dev.to react version: "^16.13.1", firebase version: "^7.15.5" , For uploadTask.on() , I tried two approaches. put everything inside it as it is ie. not using next, error and complete keywords. put the code separately into each one of them and pass them inside uploadTask.on() I am getting the error: TypeError: uploadTask.on is not a function I have referred the

Upload to firebase: TypeError: uploadTask.on is not a function

我们两清 提交于 2020-07-10 08:52:08
问题 I am doing a react POC for upload image to firebase. I have followed the firebase documentation Also referred to this blog post from dev.to react version: "^16.13.1", firebase version: "^7.15.5" , For uploadTask.on() , I tried two approaches. put everything inside it as it is ie. not using next, error and complete keywords. put the code separately into each one of them and pass them inside uploadTask.on() I am getting the error: TypeError: uploadTask.on is not a function I have referred the

Unable to retrieve image's download URL from Firebase Storage (getting exception) [NEED URGENT HELP]

末鹿安然 提交于 2020-07-09 14:55:39
问题 The code successfully uploads an image to Firebase Storage but doesn't give back the download URL. How can I fix this? I get this exception: java.lang.IllegalArgumentException: getDownloadUrl() is not supported at the root of the bucket. Why? private void uploadFile() { if (mImageUri != null) { StorageReference fileReference = mStorageRef.child(System.currentTimeMillis() + "." + getFileExtension(mImageUri)); fileReference.putFile(mImageUri).continueWithTask(new Continuation<UploadTask