We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e40d68 commit 8230fbfCopy full SHA for 8230fbf
1 file changed
apps/sim/app/api/tools/daytona/upload/route.ts
@@ -64,6 +64,14 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
64
fileName = params.fileName || userFile.name
65
} else if (params.fileContent) {
66
logger.info(`[${requestId}] Using legacy base64 content input`)
67
+ const estimatedSize = Math.floor((params.fileContent.length * 3) / 4)
68
+ if (estimatedSize > MAX_UPLOAD_SIZE_BYTES) {
69
+ const sizeMB = (estimatedSize / (1024 * 1024)).toFixed(2)
70
+ return NextResponse.json(
71
+ { success: false, error: `File size (${sizeMB}MB) exceeds upload limit of 100MB` },
72
+ { status: 400 }
73
+ )
74
+ }
75
fileBuffer = Buffer.from(params.fileContent, 'base64')
76
fileName = params.fileName || 'file'
77
} else {
0 commit comments