Skip to content

An AI-powered search engine with a generative UI

fix: align upload client MIME types with server allow-list (#823)

Yoshiki Miura8db727211bc2
diff --git a/components/file-upload-button.tsx b/components/file-upload-button.tsx
index f40650e5..8fc26421 100644
--- a/components/file-upload-button.tsx
+++ b/components/file-upload-button.tsx
@@ -9,12 +9,8 @@ import { cn } from '@/lib/utils'
import { Button } from './ui/button'
-const allowedImageTypes = ['image/png', 'image/jpeg', 'image/gif', 'image/webp']
-const allowedOtherTypes = [
- 'application/pdf',
- 'application/msword',
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
-]
+const allowedImageTypes = ['image/png', 'image/jpeg']
+const allowedOtherTypes = ['application/pdf']
const isAllowedFileType = (file: File) =>
allowedImageTypes.includes(file.type) || allowedOtherTypes.includes(file.type)
@@ -70,7 +66,7 @@ export function FileUploadButton({
<input
ref={inputRef}
type="file"
- accept="image/*,.pdf,.doc,.docx"
+ accept="image/png,image/jpeg,application/pdf"
hidden
multiple
onChange={e => {