From e66dff23b89a64c3171ae1ecff4a76557d7e7068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 15 Jul 2026 14:57:03 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20download=20ZIP/CSV=20=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=20fetch+Blob=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=BE=20window.location=20=E2=80=94=20=D0=BD=D0=B5=20=D1=81?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D1=81=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.py | 2 +- site/templates/index.html | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/site/app.py b/site/app.py index 7fa7b44..75ee250 100644 --- a/site/app.py +++ b/site/app.py @@ -20,7 +20,7 @@ if _sys_path_root not in sys.path: sys.path.insert(0, _sys_path_root) # Версия приложения (меняется при изменениях) -VERSION = "0.0.26" +VERSION = "0.0.27" def create_app(): diff --git a/site/templates/index.html b/site/templates/index.html index 544cfe1..78d745d 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -295,12 +295,32 @@ async function uploadFiles() { function downloadZip() { if (!currentSid) return; - window.location = '/api/download/' + currentSid; + fetch('/api/download/' + currentSid) + .then(r => r.blob()) + .then(blob => { + const a = document.createElement('a'); + a.href = URL.createObjectURL(blob); + a.download = 'drhider.zip'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(a.href); + }); } function downloadCsv() { if (!currentSid) return; - window.location = '/api/csv/' + currentSid; + fetch('/api/csv/' + currentSid) + .then(r => r.blob()) + .then(blob => { + const a = document.createElement('a'); + a.href = URL.createObjectURL(blob); + a.download = 'mapping.csv'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(a.href); + }); }