You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 16, 2023. It is now read-only.
When we get a response back, we should check the response headers and look for a content-disposition header. If the header contains the filename parameter then we should use that to prompt the browser to download the response to a file.
The following code may be modified to trigger the file download behavior in the browser.
function download(url, filename) {
fetch(url).then(function(t) {
return t.blob().then((b)=>{
var a = document.createElement("a");
a.href = URL.createObjectURL(b);
a.setAttribute("download", filename);
a.click();
}
);
});
}
The text was updated successfully, but these errors were encountered:
When we get a response back, we should check the response headers and look for a content-disposition header. If the header contains the filename parameter then we should use that to prompt the browser to download the response to a file.
The following code may be modified to trigger the file download behavior in the browser.
The text was updated successfully, but these errors were encountered: