Open minhchi1509 opened 5 days ago
It should be working if described properly with Zod schema, haven't tried it though. Did you try to define file as zod schema?
Something like:
const fileSchema = zod.object({
name: z.string(),
size: z.number().max(1000),
type: z.enum(["image/png", "image/jpeg"]);
});
const formSchema = z.object({
files: zod.array(fileSchema)
})
const formRule = createSchemaFieldRule(
formSchema
);
Later in the Form:
<FormItem
name="files"
rules={[formRule]}
>
<Input />
</FormItem>
Can you give more example about validating file (file type, file size, max number of files,...)?