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
From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Get started with Cloud Storage on the web3m 13s
-
(Locked)
Define an async function to send a file to storage5m 35s
-
(Locked)
Upload a file to the storage3m 17s
-
(Locked)
Download a file URL from storage6m 10s
-
(Locked)
Set documents with images: Update the UI5m 27s
-
(Locked)
Set documents with images: Set the date4m 10s
-
(Locked)
-
-
-
-
-