From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Define an async function to send a file to storage

Define an async function to send a file to storage

- [Instructor] Just like with the Cloud Firestore, you're going to see that the steps are very easy and familiar to you. So the goal here will be to create async functions to access the firebase storage bucket. So first we're going to create-- get an instance of the storage bucket. So that's going to be the first step. Let me show you actually from the documentation. We're going to go to create a reference. So first we want to add to the scope of our file, our module, the file-based storage SDK. So we need to get this method and also this one to create a reference to the storage bucket. And we're going to use this method to upload file and send files to the cloud storage. That's going to be very easy. So let's do that. We're going to start by, I'm going to copy this, okay. And go back to the source code. We're going to also implement here the instance of the cloud storage from here. Actually, I'm going to do that…

Contents