i have a server nodejs, when download a file from server
function download(info) {
var res = info.res;
var file = __dirname + '/static/downloads/abc.txt';
res.writeHead(200, {
'Content-Type': 'text/plain',
'Content-Length': stat.size
});
var readStream = fs.createReadStream(file);
readStream.pipe(res);
}
I don't understand about how can i save file to the disk in client?