I could implement the export data to csv on node webkit with node fs modules. But now I want to prompt the user to save the file in his/her desired location. Like the download pop-up in case of html. I tried doing on the lines of this code and even this file dialog. Could someone help me find a way out of this. Here's my code.
fs.writeFile("export.csv", data, function(err) {
if(err) {
console.log(err);
} else {
$('#export_file').show();
$('#export_file input').on('change', function (event) {
console.log($(this).val());
console.log("The file was saved!");
});
}
});
<div id="export_file" style="display:none">
<input type="file" nwsaveas nwworkingdir="/data/input/" />
</div>