Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

495
Views
How to get download url for a Image from Firebase Storage?

I am trying to upload an image to firebase storage after that I am trying to get the download url of image but it's not working. Below is the code :

const response = await fetch(selectedImage.uri);
const file = await response.blob();

const storageRef = ref(storage, `profile/${currentUser.email}`);
uploadBytes(storageRef, file).then( (snapshot) => {
  console.log('uploaded');
  getDownloadURL(storage).then( url => console.log(url)); // tried this outside of then block as well
});

the file is uploaded and accessible through console but getDownloadURL throws error :

[Unhandled promise rejection: TypeError: ref._throwIfRoot is not a function. (In 'ref._throwIfRoot('getDownloadURL')', 'ref._throwIfRoot' is undefined)]

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Instead of passing storage to getDownloadURL(), pass snapshot.ref.

const response = await fetch(selectedImage.uri);
const file = await response.blob();

const storageRef = ref(storage, `profile/${currentUser.email}`);
uploadBytes(storageRef, file).then( (snapshot) => {
  console.log('uploaded');
  getDownloadURL(snapshot.ref).then( url => console.log(url));
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!