fix: use native navigation for file downloads to support large files
Run Tests / Backend Tests (pull_request) Failing after 4m45s
Run Tests / Frontend Tests (pull_request) Failing after 1m20s
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 2m47s
Run Tests / Backend Tests (push) Failing after 5m52s
Run Tests / Frontend Tests (push) Failing after 1m43s
Run Tests / Test Summary (pull_request) Failing after 33s
Run Tests / Test Summary (push) Has been cancelled

This commit is contained in:
Gan, Jimmy
2026-04-18 23:57:07 +08:00
parent d260f8159a
commit b5b6f9134b
+2 -8
View File
@@ -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;