Skip to content

Commit b7ccbc8

Browse files
committed
fix
1 parent 5a78b55 commit b7ccbc8

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

apps/sim/app/api/tools/dropbox/upload/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ export async function POST(request: NextRequest) {
7979
fileBuffer = Buffer.from(validatedData.fileContent, 'base64')
8080
fileName = validatedData.fileName || 'file'
8181
} else {
82-
return NextResponse.json(
83-
{ success: false, error: 'File or file content is required' },
84-
{ status: 400 }
85-
)
82+
return NextResponse.json({ success: false, error: 'File is required' }, { status: 400 })
8683
}
8784

8885
// Determine final path

apps/sim/blocks/blocks/dropbox.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,13 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
318318
}
319319

320320
// Normalize file input for upload operation
321-
// normalizeFileInput handles JSON stringified values from advanced mode
322-
if (params.file) {
323-
params.file = normalizeFileInput(params.file, { single: true })
324-
}
325-
// Legacy: also check fileContent for backwards compatibility
326-
if (params.fileContent && !params.file) {
327-
params.fileContent = normalizeFileInput(params.fileContent, { single: true })
321+
// Check all possible field IDs: uploadFile (basic), fileRef (advanced), fileContent (legacy)
322+
const normalizedFile = normalizeFileInput(
323+
params.uploadFile || params.fileRef || params.fileContent,
324+
{ single: true }
325+
)
326+
if (normalizedFile) {
327+
params.file = normalizedFile
328328
}
329329

330330
switch (params.operation) {

0 commit comments

Comments
 (0)