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

276
Vistas
Google Drive API Extracting blob from json into javascript

I am trying to use Google Drive API v3 to get a files blob and then upload it to firebase storage.

  drive.files.get({
    fileId: fileId,
    alt: 'media',
  }, {responseType: 'blob'})
  .then(response => { 
    console.log(response.data); 


    const file = response.data
    const storage = getStorage();
    const storageRef = ref(storage, 'testvideo.mp4');
    
    // 'file' comes from the Blob or File API
    uploadBytes(storageRef, file).then((snapshot) => {
      console.log('Uploaded a blob!');
    });
  })
  .catch(err=>{ console.log(err); });
// console.log(response.data) output
Blob {
  [Symbol(type)]: 'video/mp4',
  [Symbol(buffer)]: <Buffer 00 00 00 18 66 74 79 70 6d 70 34 32 00 00 00 00 69 73 6f 6d 6d 70 34 32 00 00 00 88 66 72 65 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 20233366 more bytes>
}

I am having trouble taking the blob in json and using it in nodejs and getting this error at uploadBytes(storageRef, file).

TypeError: Cannot read properties of undefined (reading 'byteLength')

because just result.data isn't a valid blob. Essentially, I'm trying to figure out how to set

const file = new Blob([response.data.buffer], {type: response.data.type});
about 4 years ago · Juan Pablo Isaza
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