fix(files): default file name (#3585)

This commit is contained in:
Vikhyath Mondreti
2026-03-14 11:15:00 -07:00
committed by GitHub
parent c738226c06
commit 9ae656c0d5
2 changed files with 2 additions and 8 deletions
+1 -4
View File
@@ -74,10 +74,7 @@ export async function POST(request: NextRequest) {
const uploadResults = []
for (const file of files) {
const originalName = file.name
if (!originalName) {
throw new InvalidRequestError('File name is missing')
}
const originalName = file.name || 'untitled'
if (!validateFileExtension(originalName)) {
const extension = originalName.split('.').pop()?.toLowerCase() || 'unknown'
@@ -93,10 +93,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
return NextResponse.json({ error: 'No file provided' }, { status: 400 })
}
const fileName = rawFile.name
if (!fileName) {
return NextResponse.json({ error: 'File name is missing' }, { status: 400 })
}
const fileName = rawFile.name || 'untitled'
const maxSize = 100 * 1024 * 1024
if (rawFile.size > maxSize) {