mirror of https://github.com/langgenius/dify
fix: upload remote file
This commit is contained in:
parent
54110336b3
commit
93b8f3b560
|
@ -226,6 +226,10 @@ export const useFile = (fileConfig: FileUpload) => {
|
|||
uploadedId: res.id,
|
||||
url: res.url,
|
||||
}
|
||||
if (!isAllowedFileExtension(res.name, res.mime_type, fileConfig.allowed_file_types || [], fileConfig.allowed_file_extensions || [])) {
|
||||
notify({ type: 'error', message: t('common.fileUploader.fileExtensionNotSupport') })
|
||||
handleRemoveFile(uploadingFile.id)
|
||||
}
|
||||
if (!checkSizeLimit(newFile.supportFileType, newFile.size))
|
||||
handleRemoveFile(uploadingFile.id)
|
||||
else
|
||||
|
@ -234,7 +238,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, startProgressTimer])
|
||||
}, [checkSizeLimit, handleAddFile, handleUpdateFile, notify, t, handleRemoveFile, fileConfig?.allowed_file_types, fileConfig.allowed_file_extensions, startProgressTimer])
|
||||
|
||||
const handleLoadFileFromLinkSuccess = useCallback(() => { }, [])
|
||||
|
||||
|
|
Loading…
Reference in New Issue