firebase-storage

How to return failed task result in continuation task [duplicate]

霸气de小男生 提交于 2021-01-29 15:06:27
问题 This question already has an answer here : How to return failed task result in continuation task? (1 answer) Closed 9 days ago . I'm writing my first app in Kotlin and am using Firestore & Firebase Storage. In the process of deleting a document, I want to delete all files in Storage that the document references (as it is the only reference to them in my case). If the Storage delete fails, I want to abort the document delete, in order to avoid orphan files in my Storage. I also want to do

Firebase - Add many apps to one project

我只是一个虾纸丫 提交于 2021-01-29 14:23:30
问题 This is the first time i'm working with firebase. My goal is to have a bounch of client apps (more and more over time), all of them managed by an admin app (One app to rule them all). The thing is that the client apps have a certain content that needs to be updated from the admin app. My best approach is to create a firebase project, put the admin app there and adding client apps over time. I'have read that is possible to have an unlimited number of apps inside one Firebase project. On

Closure with FirebaseStorage (UIImage→URL)

你。 提交于 2021-01-29 10:11:08
问题 I am creating a new registration process using Firebase Auth / Storage / Firestore. Here is the process of new registration (first authenticate with Auth, register the returned User in Firestore, save the URL if there is an image) process. static func signUp(name: String, email: String, password: String, image: UIImage?, onSuccess: @escaping () -> Void, onError: @escaping (_ errorMessage: String?) -> Void) { Auth.auth().createUser(withEmail: email, password: password, completion: { user,

Getting : TypeError: undefined is not a function (evaluating 'filePath.replace('file://', '')') while uploading a blob to firebase storage

筅森魡賤 提交于 2021-01-29 08:26:34
问题 I am developing an small React Native POC with firebase storage in which a user selects image and uploads it to firebase storage under /uid/ directory. I am using react-native-firebase for using firebase in the application. I have the uri of the image with which i am creating its blob using RNFetchBlob and then trying to upload the blob to firebase. Here is the code for handling the blob making and uploading. handleUploadTask = (mime = 'application/octet-stream') => { const {imageSource} =

How to limit number of downloads from Firebase Storage?

可紊 提交于 2021-01-29 08:22:32
问题 As far as I can see there are no security rules in the Firebase Storage that could limit the number of downloads per user. I can limit the file size or number of files for writes with a simple trick like this: match /public/{userId}/{imageId} { allow write: if request.resource.size < 5 * 1024 * 1024 && imageId.matches("[1-5]\.txt"); } And according to Google Quotas & Limits: There is an update limit on each object of once per second, so rapid writes to a single object won’t scale. So this is

How to upload image in firebase storage 5.0.1 with flutter [duplicate]

喜欢而已 提交于 2021-01-29 08:00:59
问题 This question already has answers here : Undefined class StorageReference when using Firebase Storage (3 answers) Closed 2 months ago . Recently a new version of firebase storage just came (5.0.1). There is a lot of changes. I can't seem to upload a photo and get the download URL of the photo. Can you provide a way to do it in firebase storage 5.0.1 回答1: import 'package:firebase_storage/firebase_storage.dart' as firebase_storage; for uploading file Future<void> uploadFile(String filePath)

How to display a pdf document within an iframe by google docs viewer stored in firebase storage?

岁酱吖の 提交于 2021-01-29 05:45:23
问题 I have an iframe in which I want to put a preview of my pdf document hosted in firebase storage through google docs viewer. I am creating the html view in javascript dynamically and adding it by jquery's ('.someClass').html() method. I tried to plug in the download url of the document to the iframe directly and it works just fine and displays the preview. But I can't get it to display the preview through google docs. What I meant is that this works just fine: ....making my html on the fly in

Javascript Loop doesn't wait for Firebase to complete uploading multiple files

心已入冬 提交于 2021-01-28 14:29:50
问题 I'm trying to upload multiple files and then execute some code after all the files are uploaded but my loop doesn't wait until each upload completes. Iterating files: //files is an array of local files from a <input type="file"> for (var i = 0, f; f = files[i]; i++) { var imageFile = files[i]; var response = uploadImageAsPromise(imageFile); } //after completing all uploads, execute some code here console.log("Finished uploading all files"); Upload function: function uploadImageAsPromise

File Uploaded but not shown in the Firebase realtime database - Android Studio

夙愿已清 提交于 2021-01-28 12:19:28
问题 In my android app when I am uploading a PDF file it's uploaded in the firebase storage but the file name and url is not shown in the realtime database. private void uploadPDFFile(Uri data) { final ProgressDialog progressDialog = new ProgressDialog(this); progressDialog.setTitle("Uploading..."); progressDialog.show(); StorageReference reference = storageReference.child("uploads/"+System.currentTimeMillis()+".pdf"); reference.putFile(data) .addOnSuccessListener(new OnSuccessListener<UploadTask

Get downloadURL keeps throwing error 'XMLHttpRequest is not defined' using Firebase

你说的曾经没有我的故事 提交于 2021-01-28 12:12:07
问题 I keep getting a "XMLHttpRequest is not defined" when attempting to get the downloadURL of images I just uploaded to storage. Any thoughts on what is going on here? I can retrieve the metadata, but the image url is not listed in the scheme :/ Node: import firebase, { storage } from './firebase'; const serviceAccount = require('./serviceAccountKey.json'); const admin = require('firebase-admin'); const app = express() const dbUrl = "https://authentication.firebaseio.com" admin.initializeApp({