The node.js server code below allows the client to upload file to a temporary location.
var restify = require('restify'); var server = restify.createServer(); server.use(restify.bodyParser()); server.post('/fileupload', function(req, res, next){ var path_temp = req.files.file.path; console.log(path_temp); res.end('upload'); next(); }); server.listen(8000); The uploaded file is stored at the folder location path_temp. How can one copy this file to the current folder of the node.js script being run?