diff --git a/bun.lockb b/bun.lockb index 70a4bc8..124fa2b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/lib/components/functional/Uploader.svelte b/src/lib/components/functional/Uploader.svelte index 23e23af..28beb68 100644 --- a/src/lib/components/functional/Uploader.svelte +++ b/src/lib/components/functional/Uploader.svelte @@ -10,6 +10,7 @@ files: File[] | undefined; onupload?: () => void; isMobile: boolean; + acceptedFormats?: string[]; } $effect(() => { @@ -20,7 +21,7 @@ let fileInput = $state(); let dragOver = $state(false); - let { files = $bindable(), onupload, isMobile }: Props = $props(); + let { files = $bindable(), onupload, isMobile, acceptedFormats }: Props = $props(); function upload() { if (!fileInput) return; @@ -108,6 +109,7 @@ class="hidden" bind:this={fileInput} onchange={addFiles} + accept={acceptedFormats?.join(",") ?? "*"} multiple /> diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 14297d5..d84bec7 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -77,6 +77,7 @@ isMobile={data.isMobile} bind:files={ourFiles} onupload={runUpload} + acceptedFormats={converters.flatMap((c) => c.supportedFormats)} />