29381

Uploading a local stored image to Firebase Storage

<h3>Question</h3>

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

Recommend

  • 面向对象&从这里开始我们将不再是纯小白
  • python--lambda表达式在sort函数中的使用
  • Use of $? in an if statement conditional expression
  • Exported DLL functions not ordered lexically?
  • Space Indentation Expected in ng lint
  • Making good column names R
  • IdentityNotMappedException
  • Arrays.asList also for maps? [duplicate]
  • R data analysis - qqplot - Error msg: unimplemented type 'list' in 'greater'
  • Can't subscribe to Push notification
  • Task queue for wp8?
  • best simplest code to move a UIImage View from point A to point B
  • Why does GetAttr not work on cloudformation template parameters?
  • Multiple User Types In Django
  • Python + Tkinter Windows 7 taskbar progress
  • Jenkins job DSL plugin - hidden parameter
  • How to use Sanitize on HTML Entity
  • How to detect user changing sheet?
  • how to display same image multiple times using same image in javascript
  • Create and use temp table in nested queries
  • Firebase reverse dns lookup ENOTFOUND error node.js dns
  • How to open a serial port with pyserial?
  • .htaccess rule: multiple domains to one ssl domain
  • ASP.Net MVC entity framework submit model, then open new model in edit page
  • How to share functions between components in angular?
  • How to gracefully stop python unittest?
  • View.layout() works until next UI update
  • device tree overlay phandle
  • How exactly do you use json_decode to pass a javascript array to php?
  • ROR + MVC Disable Browser Cache
  • VB.NET and LINQ - Group by in a DataTable
  • Access to database zend framework
  • create circular Auto Horizontal Scroll View?
  • Do iTunesConnect external testers get updates for *every* uploaded ipa file after Beta Approval?
  • Julia 1.0 UndefVarError - Scope of Variable
  • java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringDispatcher-ser
  • How to merge objects within array based on attribute
  • how to get the location(lat/lng) on google maps v3 from the location(x,y)
  • `$http:badreq Bad Request Configuration` - from angular post method, what is wrong here?
  • Bitrate JWplayer