From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Upload a file to the storage
From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase
Upload a file to the storage
- [Presenter] So in the example that follows, in this video, the goal will be to update and manage the form, and then send files to the cloud storage in order to create new documents with text and media contents. We're going to start by importing to the scope Storage. And then we're going to import this method from the Storage, which is uploadFile. Here we go. And then you want to do this from this form. Like, whenever the user hit the submit button. So you want to allow first to upload the image. And we're going to pass as a parameter the information of the inputs of the file, and then it returns a Promise. I'm going to add one debugger statement right here to stop the program, and we're going to see what we get back. So once this is fulfilled, this Promise, we want to do the next step, which is to first create a new document and then run two actions locally to update the the collection, the list of items, and also…
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)
-
-
-
-
-