O'Reilly logo

Firebase Cookbook by Houssem Yahiaoui

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. To upload a file, we need to first create a new reference to the created file. We already know that we got a reference to the root folder, as we saw it earlier in this chapter. The code for creating a new reference to the created file is as follows:
      //Creating a new reference for the uploaded file.      let imageRef = packtRef.child(`images/${<imageName>.         <ext>}`);
  1. You may wonder how can we programmatically create a folder. The current API doesn't have that capability, but Firebase does it automatically. This means that since we know we're pointing to a file that is in the images folder or any sub-folder, Firebase will go and create that folder for us dynamically.
Don't forget to add the filename and it's extension once you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required