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

233
Views
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 answers
Answer question

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 Report
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!