Skip to content

Commit fdd0ace

Browse files
Update file types and add note (vercel#559)
1 parent 9dcdb7b commit fdd0ace

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

app/(chat)/api/files/upload/route.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ const FileSchema = z.object({
1111
.refine((file) => file.size <= 5 * 1024 * 1024, {
1212
message: 'File size should be less than 5MB',
1313
})
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-
),
14+
// Update the file type based on the kind of files you want to accept
15+
.refine((file) => ['image/jpeg', 'image/png'].includes(file.type), {
16+
message: 'File type should be JPEG or PNG',
17+
}),
2118
});
2219

2320
export async function POST(request: Request) {

0 commit comments

Comments
 (0)