change download file name

This commit is contained in:
Mohamed Nouffer
2021-11-16 12:03:56 +05:30
parent 8d0b9c0e76
commit 23303d48ef
9 changed files with 17 additions and 16 deletions

View File

@ -117,13 +117,14 @@ function Index() {
function downloadReport(url) {
fetch(url)
.then(async response => {
console.log(response.headers);
//console.log(response.headers);
const filename = response.headers
.get("content-disposition")
.split('"')[1];
console.log(filename)
// .split('"')[1];
const text = await response.text();
console.log(filename)
console.log(text)
//console.log(filename)
//console.log(text)
//return { filename, text };
})
.then(responseText => this.download(responseText))