If I look into the documentation containing node, I can read:
"Event: 'progress' (bytesReceived, bytesExpected)
Emitted after each incoming chunk of data that has been parsed.
Can be used to roll your own progress bar."
I am wondering how to implement my own progress bar. I mean, how to read this side of client information? I am completely confused. Is it implemented using a GET poll that starts after POST starts, or can I read the information from the POST request at boot time?
If I look at this:
http.createServer(function(req, res) {
if (req.url == '/upload' && req.method.toLowerCase() == 'post') {
var form = new formidable.IncomingForm();
form.parse(req, function(err, fields, files) {
res.writeHead(200, {'content-type': 'text/plain'});
res.write('received upload:\n\n');
res.end(sys.inspect({fields: fields, files: files}));
});
return;
}
See how / upload url handles the POST request and returns something res.write ('received download: \ n \ n');
My question is: who can read that
res.write('received upload:\n\n');
source
share