So technically i want to generate a csv using json2csv library and upon generating it wanted to download a file with a browser save dialog box such as below :
var csv = json2csv({ data: tableData.data, fields: fields });
var data = new Blob([csv], { type: 'text/plain;charset=utf-8' });
// Next : I want to download a file using a browser file dialog (wherein) i could change the filename
// FileSaver.saveAs(data, 'filename.csv');
// with this (above) i could download the file however I want the dialog box to open
Basically the desired output is like a file downloaded from a server where the browser opens up a save file dialog box (name, path, extension.. etc)
Is this possible thru client-side only?
Solutions that I've tried : Create a file in memory for user to download, not through server this also just downloads the file without opening the save file dialog
CSV Library : www.mircozeiss.com/json2csv
FileSaver.js : https://github.com/eligrey/FileSaver.js