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

237
Views
¿Cómo obtener todas las URL de las imágenes en la carpeta de firestore?

Tengo un almacenamiento en firestore que tiene una carpeta con imágenes llamada barber. Quiero enumerar todas las URL en esta carpeta usando el método getDownloadUrl a continuación. No se encontró el objeto de almacenamiento de retorno de registro de la consola. ¿Alguien puede decirme qué hago mal, por favor?

 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 answers
Answer question

0

Puede usar listAll() para enumerar todos los elementos en un directorio y luego obtener sus URL de descarga.

 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 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!