On click of a download button, I need a window that should open. User should be able to select any location for the download from the system window that pops up
This are the Request parameters I am passing to the api-
"method": "downloadCSV"
"project": "IB_SimpleProject_V2"
"dataSourceId": "DSR.4"
This is Response I am getting from it -
{ "downloadUrl": "http://localhost:8080/InBetween/...../.csv", "fileName": "<File name of csv with extension>" "message":"Download Successful", "code": 100 }
HTML:<a [href]="url" target="_blank" [download]="filename" (click)="downloadFile()">Download</a>
TS:
downloadFile(){
this.getDownload(project, dataSourceId).subscribe(res => {
if (res.code === 100) {
this.url = res.downloadUrl;
this.filename = res.fileName;
}
});
}
But I am not getting how to choose its location of download by choosing the path from the window dialog box
I am using Javascript and Angular 2+
Any help is appreciated