Skip to content

Commit 09618ed

Browse files
committed
fix(files): widen image mime mapping for chat/profile/logo uploads
1 parent d9eea95 commit 09618ed

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

apps/sim/app/api/files/upload/route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
305305
context === 'workspace-logos'
306306
) {
307307
if (context !== 'copilot' && !isImageFileType(file.type)) {
308-
throw new InvalidRequestError(
309-
`Only image files (JPEG, PNG, GIF, WebP, SVG) are allowed for ${context} uploads`
310-
)
308+
throw new InvalidRequestError(`Only image files are allowed for ${context} uploads`)
311309
}
312310

313311
if (context === 'workspace-logos') {

apps/sim/lib/uploads/utils/file-utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export const MIME_TYPE_MAPPING: Record<string, 'image' | 'document' | 'audio' |
3333
'image/gif': 'image',
3434
'image/webp': 'image',
3535
'image/svg+xml': 'image', // SVG upload is allowed; createFileContent handles it separately for Claude API
36+
'image/bmp': 'image',
37+
'image/tiff': 'image',
38+
'image/heic': 'image',
39+
'image/heif': 'image',
40+
'image/avif': 'image',
41+
'image/x-icon': 'image',
42+
'image/vnd.microsoft.icon': 'image',
3643

3744
// Documents
3845
'application/pdf': 'document',

0 commit comments

Comments
 (0)