Thursday, 15 September 2011

Sending events from Node.js to frontend javascript -



Sending events from Node.js to frontend javascript -

i can't find info on this. might asking wrong question because seems mutual task!! info? specifically, have progressbar formidable uploads.

i have basic formidable usage:

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(util.inspect({fields: fields, files: files})); });

and want add together progress bar page when it's loading. think have utilize event:

form.on('progress', function(bytesreceived, bytesexpected) { });

but i'm not sure how send event front end event js that's controlling how progress bar moves on page.

javascript node.js

No comments:

Post a Comment