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

216
Views
¿Cómo combinar múltiples datos binarios en un solo archivo?

Estoy tratando de descargar un archivo con varias partes en el servidor.

 1 file => 25 chunks

Estoy enviando una solicitud al servidor a través de Axios y obteniendo una respuesta como esta.

ingrese la descripción de la imagen aquí

Mi objetivo es enviar una solicitud de 25 fragmentos y combinar todos los datos en un solo archivo.

Mi código: - (Obteniendo un archivo no válido)

 async function getChunks() { let i = 0 for (const url of urls) { try { const response = await axios.get(url) if (i !== 0) { const data = fs.readFileSync(`test.txt`, 'utf8') console.log(typeof response.data) fs.writeFileSync('test.txt', data + response.data, 'binary') } else { fs.writeFileSync('test.txt', response.data, 'binary') } i++ } catch (error) { console.log(`unable to get chunk ${url}`) } } }
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!