From b5b6f9134bacb70b634ec796c552486e0b1c71c5 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sat, 18 Apr 2026 23:57:07 +0800 Subject: [PATCH] fix: use native navigation for file downloads to support large files --- dashboard/frontend/src/lib/api.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dashboard/frontend/src/lib/api.js b/dashboard/frontend/src/lib/api.js index 864b0e0..bb0abc7 100644 --- a/dashboard/frontend/src/lib/api.js +++ b/dashboard/frontend/src/lib/api.js @@ -217,14 +217,8 @@ export async function download(path, filename) { const { token: downloadToken } = await tokenResponse.json(); - // Use the token to trigger browser download (no memory loading) - const downloadUrl = `${BASE}/files/download?token=${downloadToken}`; - const a = document.createElement("a"); - a.href = downloadUrl; - a.download = filename; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); + // Navigate directly to download URL - browser handles streaming natively + window.location.href = `${BASE}/files/download?token=${downloadToken}`; } catch (e) { console.error("Download error:", e); throw e;