From ded3f2e99892e6f7b2f55a3a12b7a9dc0d90265f Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Fri, 10 Oct 2025 04:48:31 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=95=B8=EF=B8=8F=20fix:=20Upload=20to=20Pr?= =?UTF-8?q?ovider=20Filetype=20Filtering=20for=20DragDropModal=20(#10064)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Chat/Input/Files/DragDropModal.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/src/components/Chat/Input/Files/DragDropModal.tsx b/client/src/components/Chat/Input/Files/DragDropModal.tsx index 4b828d201d..d9003de3dc 100644 --- a/client/src/components/Chat/Input/Files/DragDropModal.tsx +++ b/client/src/components/Chat/Input/Files/DragDropModal.tsx @@ -3,6 +3,7 @@ import { useRecoilValue } from 'recoil'; import { OGDialog, OGDialogTemplate } from '@librechat/client'; import { EToolResources, + EModelEndpoint, defaultAgentCapabilities, isDocumentSupportedProvider, } from 'librechat-data-provider'; @@ -57,11 +58,22 @@ const DragDropModal = ({ onOptionSelect, setShowModal, files, isVisible }: DragD // Check if provider supports document upload if (isDocumentSupportedProvider(currentProvider || endpointType)) { + const isGoogleProvider = currentProvider === EModelEndpoint.google; + const validFileTypes = isGoogleProvider + ? files.every( + (file) => + file.type?.startsWith('image/') || + file.type?.startsWith('video/') || + file.type?.startsWith('audio/') || + file.type === 'application/pdf', + ) + : files.every((file) => file.type?.startsWith('image/') || file.type === 'application/pdf'); + _options.push({ label: localize('com_ui_upload_provider'), value: undefined, icon: , - condition: true, // Allow for both images and documents + condition: validFileTypes, }); } else { // Only show image upload option if all files are images and provider doesn't support documents