Skip to content

Commit

Permalink
fix filename
Browse files Browse the repository at this point in the history
  • Loading branch information
birm authored Feb 8, 2024
1 parent 0b9b021 commit 211e2fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/components/PathdbDownloadButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ class PathdbDownloadButton extends PureComponent {
if (window.location.protocol === "https:") {
slide_url = slide_url.replace(/^http:\/\//i, 'https://');
}
silde_fn = slide_url.split('/').at(-1);
fetch(slide_url)
.then(response => response.blob())
.then(blob => {
const a = document.createElement('a');
const url = URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.download = silde_fn;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
Expand Down

0 comments on commit 211e2fe

Please sign in to comment.