Skip to content

armgit / dify

Public Imported from GitHub
0

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.

Fix: type missing of remote file in chat (#9652)

KVOJJJind700abff0a5f
diff --git a/web/app/components/base/file-uploader/utils.ts b/web/app/components/base/file-uploader/utils.ts
index e22594a1294..4c7ef0d89b2 100644
--- a/web/app/components/base/file-uploader/utils.ts
+++ b/web/app/components/base/file-uploader/utils.ts
@@ -44,6 +44,9 @@ export const fileUpload: FileUpload = ({
}
export const getFileExtension = (fileName: string, fileMimetype: string) => {
+ if (fileMimetype)
+ return mime.getExtension(fileMimetype) || ''
+
if (fileName) {
const fileNamePair = fileName.split('.')
const fileNamePairLength = fileNamePair.length
@@ -52,9 +55,6 @@ export const getFileExtension = (fileName: string, fileMimetype: string) => {
return fileNamePair[fileNamePairLength - 1]
}
- if (fileMimetype)
- return mime.getExtension(fileMimetype) || ''
-
return ''
}