From 30005c02036ede93a50a4d44fde2bdd0c8c38717 Mon Sep 17 00:00:00 2001 From: balibabu Date: Thu, 21 Aug 2025 10:54:17 +0800 Subject: [PATCH] Fix: Remove the file size and quantity restrictions of the upload control #9613 #9598 (#9618) ### What problem does this PR solve? Fix: Remove the file size and quantity restrictions of the upload control #9613 #9598 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/app.tsx | 2 +- web/src/components/file-upload-dialog/index.tsx | 7 +------ web/src/components/file-uploader.tsx | 16 +++++++++------- .../upload-agent-dialog/upload-agent-form.tsx | 1 - .../chat/app-settings/chat-basic-settings.tsx | 1 - .../mcp/import-mcp-dialog/import-mcp-form.tsx | 2 -- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/web/src/app.tsx b/web/src/app.tsx index 4eb437948..170ecf648 100644 --- a/web/src/app.tsx +++ b/web/src/app.tsx @@ -85,7 +85,7 @@ function Root({ children }: React.PropsWithChildren) { - + ); } diff --git a/web/src/components/file-upload-dialog/index.tsx b/web/src/components/file-upload-dialog/index.tsx index a62a9e41b..df1b03c51 100644 --- a/web/src/components/file-upload-dialog/index.tsx +++ b/web/src/components/file-upload-dialog/index.tsx @@ -26,12 +26,7 @@ export function UploaderTabs({ setFiles }: UploaderTabsProps) { {t('fileManager.s3')} - + {t('common.comingSoon')} diff --git a/web/src/components/file-uploader.tsx b/web/src/components/file-uploader.tsx index b16cf2ee5..3f994fc9e 100644 --- a/web/src/components/file-uploader.tsx +++ b/web/src/components/file-uploader.tsx @@ -15,6 +15,7 @@ import { Progress } from '@/components/ui/progress'; import { ScrollArea } from '@/components/ui/scroll-area'; import { useControllableState } from '@/hooks/use-controllable-state'; import { cn, formatBytes } from '@/lib/utils'; +import { useTranslation } from 'react-i18next'; function isFileWithPreview(file: File): file is File & { preview: string } { return 'preview' in file && typeof file.preview === 'string'; @@ -168,14 +169,14 @@ export function FileUploader(props: FileUploaderProps) { accept = { 'image/*': [], }, - maxSize = 1024 * 1024 * 2, - maxFileCount = 1, + maxSize = 1024 * 1024 * 10000000, + maxFileCount = 100000000000, multiple = false, disabled = false, className, ...dropzoneProps } = props; - + const { t } = useTranslation(); const [files, setFiles] = useControllableState({ prop: valueProp, onChange: onValueChange, @@ -267,7 +268,7 @@ export function FileUploader(props: FileUploaderProps) {

- Drag {`'n'`} drop files here, or click to select files + {t('knowledgeDetails.uploadTitle')}

- You can upload + {t('knowledgeDetails.uploadDescription')} + {/* You can upload {maxFileCount > 1 ? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount} files (up to ${formatBytes(maxSize)} each)` - : ` a file with ${formatBytes(maxSize)}`} + : ` a file with ${formatBytes(maxSize)}`} */}

diff --git a/web/src/pages/agent/upload-agent-dialog/upload-agent-form.tsx b/web/src/pages/agent/upload-agent-dialog/upload-agent-form.tsx index fe93b9bdd..39a4ac012 100644 --- a/web/src/pages/agent/upload-agent-dialog/upload-agent-form.tsx +++ b/web/src/pages/agent/upload-agent-dialog/upload-agent-form.tsx @@ -63,7 +63,6 @@ export function UploadAgentForm({ hideModal, onOk }: IModalProps) { value={field.value} onValueChange={field.onChange} maxFileCount={1} - maxSize={4 * 1024 * 1024} accept={{ '*.json': [FileMimeType.Json] }} /> diff --git a/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx b/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx index 0eb968472..c2df72351 100644 --- a/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx +++ b/web/src/pages/next-chats/chat/app-settings/chat-basic-settings.tsx @@ -35,7 +35,6 @@ export default function ChatBasicSetting() { value={field.value} onValueChange={field.onChange} maxFileCount={1} - maxSize={4 * 1024 * 1024} /> diff --git a/web/src/pages/profile-setting/mcp/import-mcp-dialog/import-mcp-form.tsx b/web/src/pages/profile-setting/mcp/import-mcp-dialog/import-mcp-form.tsx index 42f6f4ed4..d34507308 100644 --- a/web/src/pages/profile-setting/mcp/import-mcp-dialog/import-mcp-form.tsx +++ b/web/src/pages/profile-setting/mcp/import-mcp-dialog/import-mcp-form.tsx @@ -59,8 +59,6 @@ export function ImportMcpForm({ hideModal, onOk }: IModalProps) {