Open MarcoTribuz opened 2 years ago
Please note this example
https://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery
fetch('https://jsonplaceholder.typicode.com/todos/1') // already done
.then(resp => resp.blob()) // already done
.then(blob => { // already done
const url = window.URL.createObjectURL(blob); //todo
const a = document.createElement('a'); //todo
a.style.display = 'none'; //todo
a.href = url; //todo
// the filename you want //todo
a.download = 'todo-1.json'; //todo
document.body.appendChild(a); //todo
a.click(); //todo
window.URL.revokeObjectURL(url); //todo
})
.catch(() => alert('oh no!'));
Handle the zip file or the pdf file