Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

content disposition attachment javascript fetch download "excel"

download(filename) {
 fetch(url , { headers })
 .then(response => response.blob())
 .then(blob => URL.createObjectURL(blob))
 .then(uril => {
 var link = document.createElement("a");
 link.href = uril;
 link.download = filename + ".csv";
 document.body.appendChild(link);
 link.click();
 document.body.removeChild(link);
 });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #content #disposition #attachment #javascript #fetch #download
ADD COMMENT
Topic
Name
6+6 =