Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: upload custom file extension (#10801)
zxhlyh986127939539
diff --git a/web/app/components/base/file-uploader/file-input.tsx b/web/app/components/base/file-uploader/file-input.tsxindex ff71cf1030d..e981278c14a 100644--- a/web/app/components/base/file-uploader/file-input.tsx+++ b/web/app/components/base/file-uploader/file-input.tsx@@ -21,7 +21,7 @@ const FileInput = ({const allowedFileTypes = fileConfig.allowed_file_typesconst isCustom = allowedFileTypes?.includes(SupportUploadFileTypes.custom)- const exts = isCustom ? (fileConfig.allowed_file_extensions?.map(item => `.${item}`) || []) : (allowedFileTypes?.map(type => FILE_EXTS[type]) || []).flat().map(item => `.${item}`)+ const exts = isCustom ? (fileConfig.allowed_file_extensions || []) : (allowedFileTypes?.map(type => FILE_EXTS[type]) || []).flat().map(item => `.${item}`)const accept = exts.join(',')return (diff --git a/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-item.tsx b/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-item.tsxindex a051b89ec18..fcf665643c4 100644--- a/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-item.tsx+++ b/web/app/components/base/file-uploader/file-uploader-in-chat-input/file-item.tsx@@ -98,6 +98,7 @@ const FileItem = ({<ProgressCirclepercentage={progress}size={12}+ className='shrink-0'/>)}diff --git a/web/app/components/base/file-uploader/hooks.ts b/web/app/components/base/file-uploader/hooks.tsindex c735754ffed..256202d7836 100644--- a/web/app/components/base/file-uploader/hooks.ts+++ b/web/app/components/base/file-uploader/hooks.ts@@ -241,7 +241,7 @@ export const useFile = (fileConfig: FileUpload) => {notify({ type: 'error', message: t('common.fileUploader.pasteFileLinkInvalid') })handleRemoveFile(uploadingFile.id)})- }, [checkSizeLimit, handleAddFile, handleUpdateFile, notify, t, handleRemoveFile, fileConfig?.allowed_file_types, fileConfig.allowed_file_extensions, startProgressTimer])+ }, [checkSizeLimit, handleAddFile, handleUpdateFile, notify, t, handleRemoveFile, fileConfig?.allowed_file_types, fileConfig.allowed_file_extensions, startProgressTimer, params.token])const handleLoadFileFromLinkSuccess = useCallback(() => { }, [])diff --git a/web/app/components/base/file-uploader/utils.ts b/web/app/components/base/file-uploader/utils.tsindex 9c71724fb26..465673435f1 100644--- a/web/app/components/base/file-uploader/utils.ts+++ b/web/app/components/base/file-uploader/utils.ts@@ -44,6 +44,12 @@ export const fileUpload: FileUpload = ({}export const getFileExtension = (fileName: string, fileMimetype: string, isRemote?: boolean) => {+ if (fileMimetype)+ return mime.getExtension(fileMimetype) || ''++ if (isRemote)+ return ''+if (fileName) {const fileNamePair = fileName.split('.')const fileNamePairLength = fileNamePair.length@@ -52,12 +58,6 @@ export const getFileExtension = (fileName: string, fileMimetype: string, isRemotreturn fileNamePair[fileNamePairLength - 1]}- if (fileMimetype)- return mime.getExtension(fileMimetype) || ''-- if (isRemote)- return ''-return ''}@@ -145,7 +145,7 @@ export const getFileNameFromUrl = (url: string) => {export const getSupportFileExtensionList = (allowFileTypes: string[], allowFileExtensions: string[]) => {if (allowFileTypes.includes(SupportUploadFileTypes.custom))- return allowFileExtensions.map(item => item.toUpperCase())+ return allowFileExtensions.map(item => item.slice(1).toUpperCase())return allowFileTypes.map(type => FILE_EXTS[type]).flat()}diff --git a/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx b/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsxindex 42a7213f803..19740844247 100644--- a/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx+++ b/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx@@ -82,8 +82,6 @@ const FileUploadSetting: FC<Props> = ({const handleCustomFileTypesChange = useCallback((customFileTypes: string[]) => {const newPayload = produce(payload, (draft) => {draft.allowed_file_extensions = customFileTypes.map((v) => {- if (v.startsWith('.')) // Not start with dot- return v.slice(1)return v})})@@ -118,7 +116,7 @@ const FileUploadSetting: FC<Props> = ({type={SupportUploadFileTypes.custom}selected={allowed_file_types.includes(SupportUploadFileTypes.custom)}onToggle={handleSupportFileTypeChange}- customFileTypes={allowed_file_extensions?.map(item => `.${item}`)}+ customFileTypes={allowed_file_extensions}onCustomFileTypesChange={handleCustomFileTypesChange}/></div>