1. 26
    Download Files from Firebase Cloud Storage in Angular
    1m 4s

Download Files from Firebase Cloud Storage in Angular

Jorge Vergara
InstructorJorge Vergara
Share this video with your friends

Social Share Links

Send Tweet
Published a year ago
Updated a year ago

Users can now see that files are attached to tasks but they can't do much with that. We need to let users be able to download the files so we'll do that in this lesson.

We'll create a button for users to download the files they have in their tasks. We take a JavaScript first approach here by creating an anchor tag and adding all of the properties we need to allow for a download.

Instructor: [0:00] We also want to give the users the ability to download this file. For that, right after the label, we are going to add a right button that when the user clicks it, it's going to call the downloadAttachment function. Passing the attachment's name and the URL to that function.

[0:22] Now we can come here to create that function. There are multiple ways to downloading documents from the browser. I'm going to go with a pure JavaScript approach. I'm going to be creating an anchor tag. Then I'm going to add all of the properties that I need.

[0:47] After I add the properties, I'm going to append this link to the body. I'm going to click the link and I'm going to remove it. When I reload, I can see my download button. If I click the button, you see that we are downloading the new image.

egghead
egghead
~ 7 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today