I need to create a text or json file and save file to user selected location in local machine using Javascript. I used below code but it downloads the file to Downloads directory
download(text:any, name:any, type:any) {
var a = document.createElement("a");
var file = new Blob([text], {type: type});
a.href = URL.createObjectURL(file);
a.download = name;
a.click();
}
Below is what I am looking
- My application has a diagram and the diagram data can be exported as json data
- User want to save this data to a file in selected location. Lets say C:\Temp, This will help in sharing the diagram data with other users and they can import it into their application
We want to implement notepad File -> SaveAs kind of functionality here