let bytes = new Uint8Array(data.length);
for (var i = 0; i <data.length; i++) {
bytes[i] =data[i];
}
let file = new Blob([bytes], { type: "text/xml" });
let link = document.createElement("a");
link.href = window.URL.createObjectURL(file);
let fileName = "file.xml";
link.download = fileName;
link.click();
this.openDialog();
I want to execute openDialog() method once the download is started on the browser.
I tried to display the dialog box after the link.click() is executed but if the browsers 'Ask where to save each file before downloading' option is turned on the dialog box is displayed before the user selects the directory and clicks okay.