change download file name

This commit is contained in:
Mohamed Nouffer
2021-11-16 09:58:21 +05:30
parent 7f88d17ce4
commit 24a0a6e975
9 changed files with 20 additions and 19 deletions

View File

@ -127,13 +127,14 @@ function Index() {
// //document.body.appendChild(link);
// link.click();
console.log(response.headers)
const url = window.URL.createObjectURL(new Blob([response.data], { type: 'application/vnd.ms-excel' }));
const link = document.createElement('a');
link.href = url;
link.target = '_blank'
link.click();
const filename = response.headers
.get("content-disposition")
.split('"')[1];
const text = response.text();
console.log(filename)
console.log(text)
//return { filename, text };
});
}