You are reading a single comment by @beweOnline and its replies. Click here to read the full conversation.
  • Thanks for your reply! While I can slice up the file into chunks and write a GET response using the node.js drain event as explained in the tutorial mentioned above, I was hoping someone could shed light on the whole matter. I'm curious as to why E.pipe() is available when E.openFile() is not! What's the use case here?

    Anyways, I post my WIP here, in case somebody's wondering. This goes into the routing callback function you'd supply to the createServer() method:

    var storage = require("Storage");
    var file ="xyz.html");
    res.writeHead(200, {'Content-Type': 'text/html'});
    // write response in packets
    var packet = 4096;
    var chunks = Math.ceil(file.length/packet);
    var n = 1;
    res.on('drain',function() {
         else if(n>=2 && n<=chunks){

Avatar for beweOnline @beweOnline started