Skip to content

Commit 5a78b55

Browse files
committed
fix
1 parent aa1b158 commit 5a78b55

File tree

1 file changed

+7
-3
lines changed
  • apps/sim/app/api/tools/dropbox/upload

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { z } from 'zod'
44
import { checkInternalAuth } from '@/lib/auth/hybrid'
55
import { generateRequestId } from '@/lib/core/utils/request'
66
import { FileInputSchema } from '@/lib/uploads/utils/file-schemas'
7-
import { processFilesToUserFiles } from '@/lib/uploads/utils/file-utils'
7+
import { processFilesToUserFiles, type RawFileInput } from '@/lib/uploads/utils/file-utils'
88
import { downloadFileFromStorage } from '@/lib/uploads/utils/file-utils.server'
99

1010
export const dynamic = 'force-dynamic'
@@ -58,7 +58,11 @@ export async function POST(request: NextRequest) {
5858
// Prefer UserFile input, fall back to legacy base64 string
5959
if (validatedData.file) {
6060
// Process UserFile input
61-
const userFiles = processFilesToUserFiles([validatedData.file], requestId, logger)
61+
const userFiles = processFilesToUserFiles(
62+
[validatedData.file as RawFileInput],
63+
requestId,
64+
logger
65+
)
6266

6367
if (userFiles.length === 0) {
6468
return NextResponse.json({ success: false, error: 'Invalid file input' }, { status: 400 })
@@ -103,7 +107,7 @@ export async function POST(request: NextRequest) {
103107
'Content-Type': 'application/octet-stream',
104108
'Dropbox-API-Arg': httpHeaderSafeJson(dropboxApiArg),
105109
},
106-
body: fileBuffer,
110+
body: new Uint8Array(fileBuffer),
107111
})
108112

109113
const data = await response.json()

0 commit comments

Comments
 (0)