const uploadFile = (Url, name) => {
axios.get(Url, { responseType: 'blob' }).then((res) => {
if (window.navigator.msSaveBlob) {
try {
const blobObject = new Blob([res.data]);
window.navigator.msSaveBlob(blobObject, `${name}.xls`);
} catch (e) {
console.log(e);
}
} else {
const url = window.URL.createObjectURL(new Blob([res.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', `${name}.xls`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
}
});
}