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

346
Views
JavaScript, creation of large files (more than 2 gb) to download from the client

I am implementing a websocket server to transfer files to clients, that is, I send the bytes of the file in parts from the server to the client, and from the client I join the byte fragments and create the file with its extension.

My problem is that the string apparently can only store and concatenate only up to 500mb approx, which would limit the generation of larger files such as 1gb or greater since it freezes.

Is there any way to buffer that large amount of data and be able to download it as files?

I have searched and found about StreamSaver.js but I have not been able to implement it with the internet examples to create that giant data buffer. Thanks!

I leave a sample of my code to pass from a hex string to files.

function CreateFile(DataHex, FileName) {
var binary = new Array();
for (var i=0; i<DataHex.length/2; i++) {
var h = DataHex.substr(i*2, 2);
binary[i] = parseInt(h,16);
}
var byteArray = new Uint8Array(binary);
var filecomp = window.document.createElement('a');
filecomp.href = window.URL.createObjectURL(new Blob([byteArray], { type: 'application/octet-stream' }));
filecomp.download = FileName;
filecomp.click();
window.URL.revokeObjectURL(filecomp.href);
}
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!