Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b5b6f9134b | |||
| d260f8159a |
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user