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

532
Views
How can I get image download url from firebase storage file, if I know what name it will be stored under?

I have a firebase resize images extension that once the image uploaded to a specific folders(profilePhotos in my case) it converts that image to smaller size(320x320 in my case) and just adds "_320x320" to the end of the name.

Initially, I had a cloud function creating urls and updating the correlating document in firestore via getSignedUrl() until I realised that all signed urls expire after 7 days.

This is how I get the original pictures download url from the front end:

              uploadTask.on(
                "state_changed",
                (snapshot) => {
                  const progress =
                    (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
                  setProgress(progress);
                },
                (error) => {
                  console.log("error" + error);
                },
                () => {
                  getDownloadURL(userUploadRef).then(async (downloadUrl) => {
                    // code that updates the document in firestore by adding the url

If I know that the only difference between the original and resized image name is that one ends with _320x320, can I just alter the download url to get the download url of my image, if so how can it be done?

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

0

Changing the download URL would only work if the access token is passed on from the original image to the resized image, which I'm not sure if it is (the Extension supported that at some point, but I recall there were issues with it).

The better approach would be to determine the download URL for the resized image name by a separate call to getDownloadURL with a reference to the correct path:

const storage = getStorage();
const resizedRef = ref(storage, 'images/stars_320x320.jpg');
getDownloadURL(resizedRef).then(...
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!