Greetings! Below is a snippet of code from my Angular component:
this.messageHistoryService.getMessageHistoriesCSV1(msgHistoryRequest).subscribe(
(data) => {
console.log(data.messageHistoryBytes);
let file = new Blob( [data.messageHistoryBytes] , { type: 'plain/text' });
let fileURL = URL.createObjectURL(file);
window.open(fileURL);
}
);
The code above successfully downloads a file in the browser. However, I would like to specify a name for the downloaded file, for example, download.csv. How can I achieve this?