Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

246
Vistas
How to get all URLs of images in folder from firestore?

I have a storage on firestore that has a folder with images called barber. I want to list all the urls in this folder using getDownloadUrl method below. The console log return storage object not found. Can someone tell me what i do wrong,please?

const mypicks = getRef(storage,'barber/')

 getDownloadURL(mypicks)
  .then((url) => {
    // `url` is the download URL for 'images/stars.jpg'

    // This can be downloaded directly:
    // const xhr = new XMLHttpRequest();
    // xhr.responseType = 'blob';
    // xhr.onload = (event) => {
    //   const blob = xhr.response;
    // };
    // xhr.open('GET', url);
    // xhr.send();

    // Or inserted into an <img> element
   console.log('url',url)
  })
  .catch((error) => {
    // Handle any errors
    console.log(error)
  });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use listAll() to list all items in a directory and then get their download URLs.

import { ref, listAll } from "firebase/storage";

// Create a reference under which you want to list
const myPicks = ref(storage, 'barber/')

listAll(myPicks)
  .then(async (res) => {
    const { items } = res;
    const urls = await Promise.all(
      items.map((item) => getDownloadURL(item))
    );

    // Array of download URLs of all files in that folder
    console.log(urls);
  })
  .catch((error) => {
    // Uh-oh, an error occurred!
  });
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda