firebase-storage

Loading Pictures from Firebase Storage to React

不问归期 提交于 2021-02-07 18:20:08
问题 I'm trying to retrieve an image url from Firebase Storage and then setting an image with that url. However, it seems that I am setting the src to an undefined value with my current code: This is my function I'm using to retrieve from Firebase Storage import {Firebase, FirebaseAuth, FirebaseDatabase, FirebaseStorage} from '../Initialize' export function getProfilePictureUrl(uid, callback, onErrorCallback) { var pathReference = FirebaseStorage.ref('profiles/' + uid + '/profilePicture.jpeg');

How to show download progress from Firebase Storage on Android

有些话、适合烂在心里 提交于 2021-02-07 14:28:28
问题 How to show downloading progress from firebase storage. I am able to download file but not able to show progress of downloading. How can I do this? Here is my simple code to download .mp3 file from firebase storage -> fun getSound(dSoundIndex : Int) { Toast.makeText(context.applicationContext,"Starting Downloading",Toast.LENGTH_SHORT).show() val mStorage = FirebaseStorage.getInstance("gs://depressioncuresounds-9e9a8.appspot.com") val mStorageRef = mStorage.reference try { val downloadRef =

Cloud Storage for Firebase access error “admin.storage(…).ref is not a function”

試著忘記壹切 提交于 2021-02-07 12:14:26
问题 I am working with Cloud Storage for Firebase and can't figure out how to to access storage files According to https://firebase.google.com/docs/storage/web/start official guide and https://firebase.google.com/docs/storage/web/create-reference this code should be returning root reference let admin = require('firebase-admin') admin.initializeApp({...}) let storageRef = admin.storage().ref() But it throws an error saying TypeError: admin.storage(...).ref is not a function package.json { "name":

Cloud Storage for Firebase access error “admin.storage(…).ref is not a function”

与世无争的帅哥 提交于 2021-02-07 12:14:16
问题 I am working with Cloud Storage for Firebase and can't figure out how to to access storage files According to https://firebase.google.com/docs/storage/web/start official guide and https://firebase.google.com/docs/storage/web/create-reference this code should be returning root reference let admin = require('firebase-admin') admin.initializeApp({...}) let storageRef = admin.storage().ref() But it throws an error saying TypeError: admin.storage(...).ref is not a function package.json { "name":

Unable to get URI from storage reference on Firebase

余生颓废 提交于 2021-02-07 06:13:28
问题 I'm trying to get an image URI that is stored in Firebase storage, in order to process it using another method. I'm using the following: FirebaseStorage storage = FirebaseStorage.getInstance(); StorageReference storageRef = storage.getReferenceFromUrl(this.getString(R.string.storage_path)); Uri uri = storageRef.child("groups/pizza.png").getDownloadUrl().getResult(); and getting an error "java.lang.IllegalStateException: Task is not yet complete" 回答1: You can get the download URL for a file

Firebase Storage: String does not match format 'base64': Invalid character found

本小妞迷上赌 提交于 2021-02-07 05:01:21
问题 I'm working on a react-native and I need to upload an image to Firebase using Firebase Storage. I'm using react-native-image-picker to select the image from the phone which gives me the base64 encoded data. When I try to upload the image to Firebase it gives me the error Firebase Storage: String does not match format 'base64': Invalid character found but I already checked if the string is a valid base64 string with regex and it is! I already read a few answers from here but I tried all that.

FireBase Storage MetaData-Updated Time returning 0?

主宰稳场 提交于 2021-02-05 11:31:28
问题 I am attempting to use Firebase to store and sync several CSV files. Copies of these CSV files are stored in internal storage. To update them locally, I am looping through all items within the Firebase Storage bucket, comparing the updated times between the two and then if there is a new version, downloading it. Everything seems to be working perfectly except the metadata fetching from Firebase, the lastupdated time of the Firebase files is always returning a zero? I find this very odd,

How to upload multiple images on firebase storage [duplicate]

你。 提交于 2021-02-05 10:45:10
问题 This question already exists : How to upload multiple files in firebase storage [closed] Closed 3 months ago . I uploaded four images on firebase storage now I want to store the four images reference in a single json tree in the firebase database. The code i have adds the images url reference for a single image to the four different fields in the database, instead of inserting each image Url reference to its respective field in the database. How can i get the specific url reference for each

How to return failed task result in continuation task?

↘锁芯ラ 提交于 2021-02-05 09:36:13
问题 I am using Google's Task API in Kotlin and am faced with the next situation: ... val deleteTask = getItem(id)?.continueWithTask { task -> if (task.isSuccessful) task.result?.toObject(ItemModel::class.java)?.let { deleteFiles(it.media) } } deleteTask?.continueWithTask { task -> if (task.isSuccessful) doSomething() } ?: doSomething() ... Where getItem(id) returns the Firebase.firestore get task ( Task<DocumentSnapshot>? ) and deleteFiles(it.media) retuens the Firebase.storage delete task ( Task

Retrieve an image from Firebase to an UIimage swift5

本小妞迷上赌 提交于 2021-02-05 09:34:06
问题 I'm struggling to download pictures from firebase storage to an UIImage in swift 5. I can well upload them. When I tried to retrieve picture, the UIImage display a black screen. here my function which return the UIImage import UIKit import Firebase func getImageEvent (imagePath : String) -> UIImage? { var myImage : UIImageView? //Access to the storage let storageRef = Storage.storage().reference(withPath: imagePath) storageRef.getData(maxSize: 1 * 1024 * 1024) {(data, error) in if let error =