firebase-storage

Firebase Storage - Wait till all upload tasks are completed before executing function

£可爱£侵袭症+ 提交于 2020-01-21 13:26:26
问题 I'm using the following code to upload one or multiple files to Firebase Storage. When the upload is completed the downloadURL is logged in the console. I would like to execute another function when all the files are uploaded, outside the forEach function. How can I print the console log when all the uploads tasks are completed? onSubmit = e => { e.preventDefault(); const { files } = this.state; files.forEach(file => { const uploadTask = Storage.ref(`files/${file.name}`).put(file); uploadTask

How to delete a file using Cloud Functions?

不打扰是莪最后的温柔 提交于 2020-01-21 01:11:05
问题 When I delete a post in my Firebase database I want a cloud function to delete the post's thumbnail in firebase storage accordingly. My issue is when I'm trying to delete the thumbnail I don't think I'm locating the image file correctly. Here is what I have tried: const functions = require('firebase-functions') const admin = require('firebase-admin') const gcs = require('@google-cloud/storage')() exports.deletePost = functions.database.ref('Posts/{pushId}').onWrite(event => { const original =

Upload multiple images to firebase storage

£可爱£侵袭症+ 提交于 2020-01-21 00:41:09
问题 i build a chat application using firebase and i want to send multiple image to firebase storage. using this library compile 'com.github.darsh2:MultipleImageSelect:3474549' At the top private StorageReference storageRef; private FirebaseApp app; private FirebaseStorage storage; onCreate()Method app = FirebaseApp.getInstance(); storage =FirebaseStorage.getInstance(app); button click action Gallary.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent

Trying to add a new bucket in firebase storage. Cannot find GCP Mumbai(asia-south1). Any clue?

心已入冬 提交于 2020-01-16 17:01:04
问题 This link shows GCP Mumbai is launched. However when I go to my firebase billing account and try to add a new bucket from firebase console, cannot find Mumbai(asia-south1) region listed. How can I debug this? 回答1: Create bucket in Mumbai GCP in Google cloud console. Go to firebase console -> storage -> add bucket Select "Import existing Google Cloud Storage buckets" Buckets will be listed Select bucket created in Mumbai GCP in Google cloud console Select continue to import 回答2: I believe your

Firebase/Node/React How to copy files from one firebase project to another?

坚强是说给别人听的谎言 提交于 2020-01-16 15:42:12
问题 I have a two Firebase projects using Storage to store files and Firestore for metadata. One project is for Staging and the other is for Production. I have a simple react app setup for uploading my files and metadata to the Staging project. I'm trying to figure out how to sync the Staging Storage and Firestores to the Production project. I haven't had much luck with google searches or the Firebase documentation (beyond seeing that you can connect to multiple firebase projects using node). Any

How can we integrate Firebase Hosting with Firebase Realtime Database / Storage?

落花浮王杯 提交于 2020-01-15 10:28:58
问题 Now that Firebase provides Web Hosting services, how can we integrate Firebase Hosting with Firebase Realtime Database and Firebase Storage? 回答1: Firebase Hosting is static hosting for your web app.So you can use HTML, CSS, JavaScript. JavaScript Code: <script src="https://www.gstatic.com/firebasejs/3.5.0/firebase.js"></script> <script> // Initialize Firebase // TODO: Replace with your project's customized code snippet var config = { apiKey: "<API_KEY>", authDomain: "<PROJECT_ID>.firebaseapp

Setting image source to Firebase Storage URL with React Native

有些话、适合烂在心里 提交于 2020-01-14 19:22:10
问题 So I am trying to set a image source to the download url that I get back from Firebase Storage...the issue is that it is not showing the image but the console and download url both show correct Storage urls to pictures... here is my code that I currently have: this.state = { itemDataSource: ds, modalVisible: false, user: undefined, imgSource: undefined, }; getTrucks(truckRef, storageRef) { truckRef.once('value', (snap) => { console.log(snap.val()); // console.log(snap.key); let trucks = [];

Firebase FIRStorageUploadTask On Swift while app is in Background state

送分小仙女□ 提交于 2020-01-14 12:45:32
问题 I'd like to implement a file upload queue for my app. Files will be uploaded to Firebase Storage. I am able to upload the files using background thread while app is in foreground mode, my challenge is to continue the upload while the app is in background state. From my research so far, using NSURLSession an app can fetch data from the network but I am not sure how to use this with Firebase API. Thanks in advance. 回答1: Question was asked ~6months ago but I was trying to solve the same problem

How to upload images to Firebase from Raspberry Pi?

时光毁灭记忆、已成空白 提交于 2020-01-14 03:19:29
问题 I am having trouble uploading images to Firebase using Python. it would be great help if someone can provide a snippet. 回答1: Take a look at gcloud-python, or our docs on using GCS APIs with Firebase Storage. From those docs: # Import gcloud from google.cloud import storage # Enable Storage client = storage.Client() # Reference an existing bucket. bucket = client.get_bucket('projectid.appspot.com') # Upload a local file to a new file to be created in your bucket. zebraBlob = bucket.get_blob(

Firebase Bucketname Not Available

*爱你&永不变心* 提交于 2020-01-14 02:32:54
问题 I'm having a weird problem with Firebase in Android. I'm trying to upload a photo to Firebase Storage and I'm getting the following error: E/UncaughtException: java.lang.IllegalArgumentException: The supplied bucketname is not available to this project. At this line of code: StorageReference mStorageRef = mFirebaseStorage.getReferenceFromUrl("gs://mooseandroid-a9f96.appspot.com"); I'm sure that the bucketname is the same as the one in the console. I even tried with a bucketname that works