firebase-storage

Firebase get Download URL after successful image upload to firebase storage

北战南征 提交于 2020-01-11 00:07:27
问题 I am trying to upload a single image to Firebase Storage, then grab its download url and assign this to a variable. I can upload my image to firebase successfully, however I cannot retrieve the download url. here is what I have tried already. upload() { let storageRef = firebase.storage().ref(); let success = false; for (let selectedFile of [(<HTMLInputElement>document.getElementById('file')).files[0]]) { let router = this.router; let af = this.af; let folder = this.folder; let path = `/$

Firebase Storage Post rules apply to Delete rules

人走茶凉 提交于 2020-01-10 19:39:26
问题 This are my rules, applied to an img dir: match /img { match /{fileId} { allow read, write: if request.resource.contentType.matches('image/jpeg') || request.resource.contentType.matches('image/png') || request.resource.contentType.matches('image/gif') && request.resource.size < 2 * 1024 * 1024 } } } The problem is that those rules are also being applied to delete() as it is a write method too, so it always returns a permission error. I couldn't find anything in the documentation regarding

Firebase Storage & Cloud Functions - ECONNRESET

我是研究僧i 提交于 2020-01-10 02:10:13
问题 I developed a Firebase Cloud function that processes several manipulations on uploaded images. My code is based on this documentation article and this Cloud Function example. Hence, it is using Google Cloud Storage package. It is working fine almost all the time, but sometimes I am getting this error when uploading to or deleting from Storage : Error: read ECONNRESET at exports._errnoException (util.js:1026:11) at TLSWrap.onread (net.js:569:26) I am using the default bucket of my application,

Using websocket-stream to upload file to Cloud Storage with Firebase Node.js?

橙三吉。 提交于 2020-01-06 08:48:29
问题 I am struggling with finding a good way to upload bigger files from the web browser to Google Cloud Storage in a Firebase project. Now I want to try the websocket-stream package. However I do not understand how to set it up in Firebase. Is it possible? From the documentation you should do this in Node.js : var websocket = require('websocket-stream') var wss = websocket.createServer({server: someHTTPServer}, handle) Where this is assumed: var someHTTPServer = http.createServer(); How do I get

Problem with the UploadTask from putString()

只愿长相守 提交于 2020-01-06 08:47:26
问题 I am having problems with the UploadTask from Firebase Storage. I am trying to upload an image and then saving the image URL on Firestore Cloud. To do so I have this code: newuploadImage() { this.image = 'movie-' + new Date().getTime() + '.jpg'; let storageRef: any, parseUpload: any; storageRef = firebase.storage().ref('imgs/' + this.image); parseUpload = storageRef.putString(this.cameraImage, 'data_url') parseUpload.on('state_changed', function (snapshot) { }, function (error) { }, function

Set the location path to Firebase Storage from a Google Cloud Function?

落爺英雄遲暮 提交于 2020-01-06 08:05:07
问题 I'm working on getting an audiofile from Google Text-to-Speech and then writing the file to Firebase Storage. I don't understand where I specify the path to the location in Storage. I tried: const bucket = storage.bucket('myProject-cd99d.appspot.com/Audio/Spanish/test.ogg'); but I get an error message: TypeError: Path must be a string . Here's the cloud function: exports.Google_T2S = functions.firestore.document('Users/{userID}/Spanish/T2S_Request').onUpdate((change, context) => { if (change

How to retrieve images from firebase storage and place in RecycleView: android., I'm trying to retrieve the images in the uploads! folder

拈花ヽ惹草 提交于 2020-01-06 06:57:38
问题 I am trying to get the images from firebase storage into my app on recycler view. The text related to the image is coming up but no image is shown. I am not sure where I am going wrong. I am using Picasso in my ImageViewAdapter to get the images. //This Is my imageViewAdapter public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ImageViewHolder> { private Context context; private List<Upload> mupload; public ImageAdapter(Context context, List<Upload> uploads){ this.context =

Images not displaying in imageView

笑着哭i 提交于 2020-01-06 04:58:08
问题 Currently nothing happens when I touch a button which takes me to another VC which is supposed to get an image from firebase and then display it in an image view on the VC after pressing a button called, loadImageFunc What is wrong in my code? I am getting no errors. It just does not work. import UIKit import FirebaseStorage import FirebaseDatabase import FirebaseAuth import Firebase ​ class PhaseOneViewController: UIViewController { @IBOutlet weak var p1ImageView: UIImageView! ​ @IBAction

Images not displaying in imageView

早过忘川 提交于 2020-01-06 04:58:07
问题 Currently nothing happens when I touch a button which takes me to another VC which is supposed to get an image from firebase and then display it in an image view on the VC after pressing a button called, loadImageFunc What is wrong in my code? I am getting no errors. It just does not work. import UIKit import FirebaseStorage import FirebaseDatabase import FirebaseAuth import Firebase ​ class PhaseOneViewController: UIViewController { @IBOutlet weak var p1ImageView: UIImageView! ​ @IBAction

Folder in Firebase storage does not get deleted? [duplicate]

自作多情 提交于 2020-01-06 04:35:27
问题 This question already has an answer here : Delete folder with contents from Firebase Storage [duplicate] (1 answer) Closed 8 months ago . I am trying to delete content within a folder in firebase storage: I attempt to do so with the following function: let storageRef = Storage.storage().reference().child((Auth.auth().currentUser?.uid)!).child("post:\(selectedPost.media[0].postID!)/") // let postRef = storageRef.child("image.png") // Delete the file storageRef.delete { error in if error != nil