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

262
Views
cómo cargar una lista de imágenes en el almacenamiento de Firebase y obtener todas las direcciones URL

Estoy usando el almacenamiento de firebase para cargar las imágenes y luego almacenar las direcciones URL en firebase db. Lo estoy usando para cargar la lista de imágenes, pero el siguiente código funciona bien en firebase v8 pero no en la versión 9

 export const multiImageUpload = async (path = "Products", imageFileList) => { let imagesUrlArray = []; let imageUrl = ""; // array of files let arr = imageFileList.map((item) => { return item.originFileObj; }); for (let i = 0; i < arr.length; i++) { const upload = await storage.ref(`/${path}/${arr[i].name}`).put(arr[i]); imageUrl = await upload.ref.getDownloadURL(); imagesUrlArray.push(imageUrl); } return imagesUrlArray; // array of URLS of uploaded files };

arroja un error de que ref.put no es una función, guíeme por qué recibo ese error.

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

0

importar { ref, getDownloadURL, uploadBytesResumable, uploadBytes } desde 'firebase/storage';

 // Upload the multiple images const multiImage = async (imageFileList) => { /* eslint no-var: 0 */ const imagesUrlArray = []; /* eslint no-var: 0 */ for (let i = 0; i < imageFileList.length; i++) { const id = uuidv4(); const metadata = { contentType: 'image/jpeg' }; /* eslint-disable no-await-in-loop */ const storageRef = ref(storage, `images/${id}`); const upload = await uploadBytes(storageRef, imageFileList[i], metadata); const imageUrl = await getDownloadURL(storageRef); imagesUrlArray.push(imageUrl); } return imagesUrlArray; // array of URLS of uploaded files };
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!