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: sandbox can upload multiple files by upload (#17323)

Joel98345c0f6547
diff --git a/web/app/components/datasets/create/file-uploader/index.tsx b/web/app/components/datasets/create/file-uploader/index.tsx
index 63bd5542150..84ef226d34d 100644
--- a/web/app/components/datasets/create/file-uploader/index.tsx
+++ b/web/app/components/datasets/create/file-uploader/index.tsx
@@ -204,10 +204,13 @@ const FileUploader = ({
if (!e.dataTransfer)
return
- const files = [...e.dataTransfer.files] as File[]
+ let files = [...e.dataTransfer.files] as File[]
+ if (notSupportBatchUpload)
+ files = files.slice(0, 1)
+
const validFiles = files.filter(isValid)
initialUpload(validFiles)
- }, [initialUpload, isValid])
+ }, [initialUpload, isValid, notSupportBatchUpload])
const selectHandle = () => {
if (fileUploader.current)