Can I upload image to firebase storage from img tag

ぐ巨炮叔叔 提交于 2021-02-04 08:32:47

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/58980988/can-i-upload-image-to-firebase-storage-from-img-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!