diff --git a/src/components/Controlbar.tsx b/src/components/Controlbar.tsx index 1e7911d..0f84a06 100644 --- a/src/components/Controlbar.tsx +++ b/src/components/Controlbar.tsx @@ -25,7 +25,11 @@ export default component$(() => { } try { - await api.upload(uploadingFile.value as File) + const unsafe = uploadingFile.value as File; + const name = unsafe.name.replace(/[^a-zA-Z0-9_.-]/g, "_"); + const f = new File([unsafe], name, { type: unsafe.type }); + + await api.upload(f); files.value = await api.list(); } catch (error) { console.error("Error uploading file:", error);