We’re rewarding the question askers & reputations are being recalculated! Read more.
2 of 2 added 687 characters in body

If I understand correctly, the problem is that you or the user in question is mostly proficient in JavaScript and would like to employ it. If you just drag an drop a file into the Browser window, the DOM and subsequent rendering step will incur great overhead, in your case even leading to premature application termination due to an out of memory exception.

You can use JavaScript standalone. So you could use either use

  • node.js, Rhino or
  • the Browser's FileReader API and a simple REST Endpoint

You should be able to effortlessly open GB sized files in a FileReader object, with the caveat that the following approach is not the best performing. Then in a loop you would read blocks of say 5MB into memory, process these and push these to a webserver (ideally at localhost/ You could use a simple php script for that (name it index.php). Something like:

<?php file_put_contents("outfile".date().".tsv", implode('', $_POST); , FILE_APPEND); ?>


  • You should probably do some filtering on the $_POST variable first, and put a PHP_Session ID into the filename.

  • Through another short php/some-language script you could offer the user to compress said output-file and let the user download it. The script checks if the archive already exists, and if not inform the user to try again later.

  • You should do the POSTing of the processed content through AJAX calls. If you do not want to use a comprehensive library such as jQuery for that purpose consider using is-lib's setFile function.


For an hands-on example of the File-Reader see this project, and look up the MDN Reference for more information.

Good luck.