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

225
Views
Cómo cargar un archivo en Drive usando la API de Drive que se obtiene de algún otro sistema en node.js

Extraigo un archivo de un sistema de terceros y devuelve los datos en la respuesta como una cadena. Ahora, cuando usa esa cadena para cargar en la unidad, se está cargando pero el archivo no se abre. Intenté convertir la cadena a Blob pero no es posible en node.js. ¿Cómo puedo cargar correctamente usando esa cadena de datos?

 let res=await axios.get("getting the file from 3rd party system",headers); let fileToUpload=res.data; // storing the file in variable let data={ name:'image.png', parents:['1BD50Xdf5456ghec8Ccwa5YNEkpgPaOxdE_M'] }; let head={ headers: { 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length':127494, 'Authorization': 'Bearer '+driveaccessToken } }; //request to upload metadata res=await axios.post('https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable',JSON.stringify(data),head); //getting the content upload url from response let uploadUrl=res.headers.location; //uploading the content res = await axios.put(uploadUrl,fileToUpload,head); console.log(res.status);

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!