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

194
Vistas
How to properly upload image to Firebase Storage and save link to firestore

Looked at this link How to upload image to firebase storage and save reference in the database in single transaction?, the recommended ones below it, softauthor and a few other sites to find out what I'm doing wrong but none worked. I'm trying to post the image to Storage then update the link in RTDB and Firestore. Here's the snippet, what am I doing wrong? (403 error) + Object { code_: "storage/object-not-found"

updatePfp.addEventListener("change", (e) => {
  file = e.target.files[0];
  var storageRef = firebase.storage().ref("users").child(user.uid);
  storageRef.put(file)
  firebase.storage().ref("users").child(user.uid).getDownloadURL()
    .then(imgUrl => {
      var downloadURL = imgUrl;
      db.collection("userInfo")
        .doc(user.uid)
        .update({
          downloadURL: downloadURL,
        })
        .then(function() {
          alert("saved");
        })
        .catch(function(error) {
          alert(error);
        });
    });
});

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to wait until the file has been completely uploaded before you can request its download URL.

storageRef.put(file).then(() => {
  firebase.storage().ref("users").child(user.uid).getDownloadURL()
    .then((downloadURL) => {
      ...
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