mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-13 04:46:52 +08:00
Fix: type missing of remote file in chat (#9652)
This commit is contained in:
@@ -44,6 +44,9 @@ export const fileUpload: FileUpload = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getFileExtension = (fileName: string, fileMimetype: string) => {
|
export const getFileExtension = (fileName: string, fileMimetype: string) => {
|
||||||
|
if (fileMimetype)
|
||||||
|
return mime.getExtension(fileMimetype) || ''
|
||||||
|
|
||||||
if (fileName) {
|
if (fileName) {
|
||||||
const fileNamePair = fileName.split('.')
|
const fileNamePair = fileName.split('.')
|
||||||
const fileNamePairLength = fileNamePair.length
|
const fileNamePairLength = fileNamePair.length
|
||||||
@@ -52,9 +55,6 @@ export const getFileExtension = (fileName: string, fileMimetype: string) => {
|
|||||||
return fileNamePair[fileNamePairLength - 1]
|
return fileNamePair[fileNamePairLength - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileMimetype)
|
|
||||||
return mime.getExtension(fileMimetype) || ''
|
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user