I am building a text editor in Node.js where a user create a file in a textarea. When he is done editing the file, he can push an \"export\" button that triggers a Jquery fu
I tested this on my server and it worked. It was from a GET call but I don't see why it wouldn't work with a POST.
res.setHeader('Content-disposition', 'attachment; filename=theDocument.txt');
res.setHeader('Content-type', 'text/plain');
res.charset = 'UTF-8';
res.write("Hello, world");
res.end();