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

159
Views
Firebase Storage: carga con solo 9B

Estoy tratando de enviar archivos al almacenamiento de Firebase en mi archivo JS (.png), se ve bien, pero cuando miro el repositorio, el archivo es un 9B (¿corrompido?). Leí el documento de Google muchas veces, pero no me di cuenta de lo que estaba haciendo mal, por favor AYUDA.

Mi entrada en el html...

<input name="foto aluno" id="photo" type="file"/>

Mi JS:

 document.getElementById('photo').addEventListener('change', handleFileSelect, false); var handleFileSelect = function(e){ e.stopPropagation(); e.preventDefault(); var file = e.target.files[0]; var storageRef = top.firebase.storage().ref(); console.log(file); var metadata = { 'contentType': file.type, 'contentLength': file.size }; storageRef.child('/imagem' + file.name).put(file, metadata).then(function(snapshot) { console.log('Uploaded', snapshot.totalBytes, 'bytes.'); console.log('File metadata:', snapshot.metadata); snapshot.ref.getDownloadURL().then(function(url) { console.log('File available at', url); }); }).catch(function(error) { console.error('Upload failed:', error); }); };

y finalmente, el resultado en la imagen firebase 9B

about 4 years ago · Juan Pablo Isaza
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!