Fix download button and API prefix issues #53
@@ -217,14 +217,8 @@ export async function download(path, filename) {
|
|||||||
|
|
||||||
const { token: downloadToken } = await tokenResponse.json();
|
const { token: downloadToken } = await tokenResponse.json();
|
||||||
|
|
||||||
// Use the token to trigger browser download (no memory loading)
|
// Navigate directly to download URL - browser handles streaming natively
|
||||||
const downloadUrl = `${BASE}/files/download?token=${downloadToken}`;
|
window.location.href = `${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);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Download error:", e);
|
console.error("Download error:", e);
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
Reference in New Issue
Block a user