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

305
Views
La imagen de carga de Firebase v9 muestra solo 9 bytes

estoy usando react native y firebase (v9) para cargar la imagen en firebase. en el almacenamiento de Firebase, el archivo se cargó, pero el tamaño es de solo 9 bytes, por lo que no se abre correctamente. no se como arreglar esto :S

 const uploadFiles = (file, name, storeKey) => { if(!file){ console.log('no file exists') return; } const exe = file.substring(file.lastIndexOf('.')); const fileName = name + exe; const storageRef = ref(storage, `/files/${fileName}`); const uploadTask = uploadBytesResumable(storageRef, file); uploadTask.on('state_changed', null, (error) => { alert(error); }, () => { getDownloadURL(uploadTask.snapshot.ref) .then((URL) => { setDoc(doc(db, 'Store', storeKey, 'coffeeDB', name), {postImage: URL}, {merge: true}); console.log('url registered') }); } ) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Dado que está llamando a file.substring(...) , parece que file es un nombre de archivo. No puede cargar un archivo simplemente pasando su nombre, ya que sería un riesgo de seguridad. En su lugar, deberá pasar un Blob | Uint8Array | ArrayBuffer como se muestra aquí y aquí , generalmente pasando la referencia del File de donde obtuvo el nombre del archivo.

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!