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

275
Views
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
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!