This commit is contained in:
@@ -308,11 +308,15 @@ async function uploadFiles() {
|
||||
function downloadZip() {
|
||||
if (!currentSid) return;
|
||||
fetch('/api/download/' + currentSid)
|
||||
.then(r => r.blob())
|
||||
.then(blob => {
|
||||
.then(r => {
|
||||
const disp = r.headers.get('Content-Disposition');
|
||||
const m = disp && disp.match(/filename="?(.+?)"?$/);
|
||||
return Promise.all([r.blob(), m ? m[1] : 'drhider.zip']);
|
||||
})
|
||||
.then(([blob, fname]) => {
|
||||
const a = document.createElement('a');
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.download = 'drhider.zip';
|
||||
a.download = fname;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
@@ -323,11 +327,15 @@ function downloadZip() {
|
||||
function downloadCsv() {
|
||||
if (!currentSid) return;
|
||||
fetch('/api/csv/' + currentSid)
|
||||
.then(r => r.blob())
|
||||
.then(blob => {
|
||||
.then(r => {
|
||||
const disp = r.headers.get('Content-Disposition');
|
||||
const m = disp && disp.match(/filename="?(.+?)"?$/);
|
||||
return Promise.all([r.blob(), m ? m[1] : 'mapping.csv']);
|
||||
})
|
||||
.then(([blob, fname]) => {
|
||||
const a = document.createElement('a');
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.download = 'mapping.csv';
|
||||
a.download = fname;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
|
||||
Reference in New Issue
Block a user