Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
How to Split a file within byte ranges in NodeJS

I am trying to upload a large video to an API. The API made it mandatory that the video must be split into multiple files and uploaded via different URLs that were given to me in a previous initializeUploadRequest.

Now imagine I have a file mymove.mp4 and I am to split the file within this byte range : firstByte= 0 and lastByte= 4194303.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

By "split the file", I assume your objective is to send an upload of each byte range portion of the file.

An efficient way to do that is to stream the file to the upload endpoint. You can create a readStream that will stream just a byte range using the start and end options for fs.createReadStream(filename, options).

const readStream = fs.createReadStream(filename, {
  start: firstByte,
  end: lastByte
});

Then, you would presumably use something like .pipe() to integrate this stream with your upload request. You don't show your upload code for us to offer an example of how you would integrate this into that.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda