diff --git a/frontend/pages/export/index.vue b/frontend/pages/export/index.vue index 837d348..2baed11 100644 --- a/frontend/pages/export/index.vue +++ b/frontend/pages/export/index.vue @@ -62,13 +62,19 @@ const setupPage = async () => { setupPage() -function downloadFile(row) { +async function downloadFile(row) { + const response = await useNuxtApp().$api.raw(row.url, { + method: "GET", + responseType: "blob" + }) + const objectUrl = URL.createObjectURL(response._data as Blob) const a = document.createElement("a") - a.href = row.url + a.href = objectUrl a.download = row.file_path.split("/").pop() document.body.appendChild(a) a.click() document.body.removeChild(a) + URL.revokeObjectURL(objectUrl) } const showCreateExportModal = ref(false)