【发布时间】:2018-11-13 18:00:56
【问题描述】:
我想在 Firebase 存储中上传图片。我知道如何使用 Uri 在 Firebase 中上传图片。但是有没有一种方法可以使用链接将图像上传到 Firebase?
我在我的项目中使用了一个 API,我每个月只能达到 1000 个,所以我试图在从 API 中获取图像后立即将其保存在 Firebase 中。 API 提供了一个图片链接,我使用该链接在 Picasso 的 imageview 中显示图片。
假设我的链接是http://xxx.xx.xxx.......png?我已将其转换为 Uri 使用 Uri.parse(link)。当我尝试这样做时,Firebase 给了我一个例外。
异常
StorageException: No content provider: http://xx.xx.com/xx/xx/xxx/xx/xx.png?
java.io.FileNotFoundException: No content provider: http://xx.xx.com/xx/xx/xx/xx/xx.png?
【问题讨论】:
标签: android firebase firebase-storage