I'm not able to return a file, when submitting a HTTP post
I know that all of my code is functioning, up until the download / sendfile part.
var postData = req.body;
var outputString = "";
mkdirp('./server/tmp');
_.each(postData, function (each) {
outputString += each.variable + ": " + each.value + " !default;\n";
});
fs.writeFile(path.resolve("./server/tmp/ionic.app.scss"), outputString);
res.attachment(path.resolve("./server/tmp/ionic.app.scss"));
res.end('hello,world\nkeesun,hi', 'UTF-8');
How can I make it so that, when the user clicks a button, it sends a POST request, which in turn downloads a file that is created on the fly by the node server?