我无法从Firebase Storage(Angular/Ionic)获取图像downloadUrl [英] I can't get image downloadUrl from Firebase Storage (Angular/Ionic)

查看:79
本文介绍了我无法从Firebase Storage(Angular/Ionic)获取图像downloadUrl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Firebase获取图像的downloadUrl,"timeCreated","fullPath","contentType"之类的所有属性均正常运行&正确推!但我不知道为什么"downloadUrl"不起作用!

I'm trying to get downloadUrl for an image from firebase, All properties like 'timeCreated', 'fullPath', 'contentType' are working well & pushed correctly! but I don't know why 'downloadUrl' doesn't work!!

captureAndUpload() {
    this.dataProvider.captureImage().then(data => {
     this.dataProvider.uploadImage(data).then(res => {
        this.dataProvider.storeImageInformation(res.downloadURL);
      });

    });
  }

数据提供者:

storeImageInformation(downloadURL)
 {
this.db.list(`/profiles/${this.afAuth.auth.currentUser.uid}`).
push(downloadURL); 
      }

有什么想法吗?!

推荐答案

现在无法在上传的即时结果中访问下载URL.几个月前,对Firebase客户端SDK进行了此更改.

The download URL is now no longer accessible in the immediate results of the upload. This change was made a few months ago to the Firebase client SDKs.

相反,您必须调用 getDownloadURL (或该JavaScript函数的任何Angular绑定)在完成上传后将URL作为第二个请求.

Instead, you will have to call getDownloadURL (or whatever the Angular binding is for that JavaScript function) to get the URL as a second request after the upload is complete.

这篇关于我无法从Firebase Storage(Angular/Ionic)获取图像downloadUrl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆