问题
I am trying to do what should be a pretty simple operation.
I have the following image in the same directory as my app.js
Project
|______ app.js
|
|______ image.png
I would like to upload this image.png in my firebase storage. According to my understanding I would need to make it a blob.. or am I wrong? How could I tackle that?
This is my most recent attempt:
var ref = firebase.storage().ref().child("userImages/" + firebase.auth().currentUser.uid);
ref.put('./image.png'.blob());
Any ideas on how I can go about doing this? Is this only possible using external libraries?
I am also looking to see if there is a proper/better way to do this over some others.
来源:https://stackoverflow.com/questions/61884123/uploading-a-local-stored-image-to-firebase-storage