From 7dde01e74bafd680d7b9131e902c6d324ae3cbc2 Mon Sep 17 00:00:00 2001 From: Waleed Date: Sun, 5 Oct 2025 17:50:21 -0700 Subject: [PATCH] fix(kb): force kb uploads to use serve route (#1547) --- apps/sim/app/api/files/presigned/route.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/sim/app/api/files/presigned/route.ts b/apps/sim/app/api/files/presigned/route.ts index bcf88b5129..8d98d34af0 100644 --- a/apps/sim/app/api/files/presigned/route.ts +++ b/apps/sim/app/api/files/presigned/route.ts @@ -265,9 +265,8 @@ async function handleS3PresignedUrl( ) } - // For chat images, knowledge base files, and profile pictures, use direct URLs since they need to be accessible by external services const finalPath = - uploadType === 'chat' || uploadType === 'knowledge-base' || uploadType === 'profile-pictures' + uploadType === 'chat' || uploadType === 'profile-pictures' ? `https://${config.bucket}.s3.${config.region}.amazonaws.com/${uniqueKey}` : `/api/files/serve/s3/${encodeURIComponent(uniqueKey)}`