We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dcdb7b commit fdd0aceCopy full SHA for fdd0ace
app/(chat)/api/files/upload/route.ts
@@ -11,13 +11,10 @@ const FileSchema = z.object({
11
.refine((file) => file.size <= 5 * 1024 * 1024, {
12
message: 'File size should be less than 5MB',
13
})
14
- .refine(
15
- (file) =>
16
- ['image/jpeg', 'image/png', 'application/pdf'].includes(file.type),
17
- {
18
- message: 'File type should be JPEG, PNG, or PDF',
19
- },
20
- ),
+ // Update the file type based on the kind of files you want to accept
+ .refine((file) => ['image/jpeg', 'image/png'].includes(file.type), {
+ message: 'File type should be JPEG or PNG',
+ }),
21
});
22
23
export async function POST(request: Request) {
0 commit comments