Retrieving Images URL from firebase storage

8,273 views
Skip to first unread message

Tirlochan arora

unread,
Nov 24, 2021, 11:09:36 AM11/24/21
to Firebase Google Group

Good afternoon everyone,

My name is Tirlochan and I am a NodeJS developer. I have a question regarding NodeJS and Firebase, if anyone can help me out. I am building a personal project for a practice where users can upload images to the server. I am not storing images directly into the database, due to storage and efficiency issues so I thought to upload the image to firebase storage and store the link of that image in the MongoDB database.
I am successful in uploading the image to firebase storage using NodeJS with "firebase-admin" SDK but I am not able to get a public link for that image that can be used to display that image on the website. Can anyone help me out on how to achieve this?

Rodrigo de França Miss Nairnei

unread,
Nov 24, 2021, 12:10:42 PM11/24/21
to Firebase Google Group

Hi, if your website use the firebase`s js lib.
You can get the download url like this:

storageRef.child('images/stars.jpg').getDownloadURL().then.... 

This give to u a publick link to download or show the file

See this:
https://firebase.google.com/docs/storage/web/download-files?hl=pt-br

On the admin have a similar function to create the link

Att.

Kato Richardson

unread,
Nov 24, 2021, 5:06:18 PM11/24/21
to fireba...@googlegroups.com
Hello Tirlochan, 

So great to meet you. There is an example on getting the download URL here, and we have a codelab that covers uploading and obtaining the URL here.

I hope that helps!
☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/f5cf70dd-55d2-4d1a-b81f-d5cdd03c565bn%40googlegroups.com.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages