我可以从img标签将图像上传到Firebase存储吗 [英] Can I upload image to firebase storage from img tag

查看:49
本文介绍了我可以从img标签将图像上传到Firebase存储吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以将图像从URL上传到Firebase Storage吗?实际上,场景是有一个img标签,我想以编程方式将该图像上传到Firebase storge.如果无法做到这一点,firebase存储中是否有任何选项可以将其从外部Link/Url上传?

Can I upload images from URL to Firebase Storage? Actually the scenario is that there is a img tag, and I want to upload that image to the firebase storge programmatically. If this can not be done, is there any option in firebase storage that we can upload it from external Link/Url?

推荐答案

Firebase不提供任何工具以编程方式将URL的内容上传到Cloud Storage.您要做的是编写一些代码,以将URL的内容下载到内存中,然后使用

Firebase does not provide any tools to programmatically upload the contents of a URL to Cloud Storage. What you will have to do is write some code to download the contents of the URL into memory, then use the put() method provided by the Firebase SDK to upload that data to Cloud Storage.

这篇关于我可以从img标签将图像上传到Firebase存储吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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