mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-02 05:47:31 +08:00
### What problem does this PR solve? Fix: Add folder upload #9743 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -20,8 +20,16 @@ import { Switch } from '../ui/switch';
|
||||
function buildUploadFormSchema(t: TFunction) {
|
||||
const FormSchema = z.object({
|
||||
parseOnCreation: z.boolean().optional(),
|
||||
// Update schema to allow files with path property to handle folder uploads
|
||||
fileList: z
|
||||
.array(z.instanceof(File))
|
||||
.array(
|
||||
z.instanceof(File).or(
|
||||
z.object({
|
||||
file: z.instanceof(File),
|
||||
path: z.string(), // Store the relative path for files in folders
|
||||
}),
|
||||
),
|
||||
)
|
||||
.min(1, { message: t('fileManager.pleaseUploadAtLeastOneFile') }),
|
||||
});
|
||||
|
||||
@@ -72,7 +80,7 @@ function UploadForm({ submit, showParseOnCreation }: UploadFormProps) {
|
||||
)}
|
||||
</RAGFlowFormItem>
|
||||
)}
|
||||
<RAGFlowFormItem name="fileList" label={t('fileManager.file')}>
|
||||
<RAGFlowFormItem name="fileList" label={''}>
|
||||
{(field) => (
|
||||
<FileUploader
|
||||
value={field.value}
|
||||
|
||||
Reference in New Issue
Block a user