We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbd6251 commit e40418fCopy full SHA for e40418f
src/app/api/files/upload/route.ts
@@ -39,7 +39,14 @@ export async function POST(req: Request) {
39
}
40
41
const data = result.data;
42
- const newFile = data.file;
+ const newFile = data.file as File;
43
+
44
+ if (!(newFile instanceof File)) {
45
+ return NextResponse.json(
46
+ { error: 'Invalid file upload' },
47
+ { status: 400 },
48
+ );
49
+ }
50
51
if (newFile.size === 0) {
52
return NextResponse.json(
0 commit comments