From 5abcb97e98a720d265e750ccfb39283c2b553d70 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Thu, 25 Apr 2024 19:10:03 +0200 Subject: [PATCH] fix cleanup of base64 string for zips --- resources/js/Pages/Teams/Partials/ImportData.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/js/Pages/Teams/Partials/ImportData.vue b/resources/js/Pages/Teams/Partials/ImportData.vue index e439ba7d..2416f119 100644 --- a/resources/js/Pages/Teams/Partials/ImportData.vue +++ b/resources/js/Pages/Teams/Partials/ImportData.vue @@ -48,7 +48,10 @@ async function importData() { ); return; } - const base64String = await toBase64(files.value[0]); + const rawBase64String = await toBase64(files.value[0]); + const base64String = rawBase64String + .split(';')[1] + .replace('base64,', '') as string; const organizationId = getCurrentOrganizationId(); if (organizationId !== null) { const { handleApiRequestNotifications } = useNotificationsStore(); @@ -57,7 +60,7 @@ async function importData() { api.importData( { type: importType.value.key, - data: base64String.replace('data:text/csv;base64,', ''), + data: base64String, }, { params: {