Validate a file type #165
Answered
by
fabian-hiller
jdgamble555
asked this question in
Q&A
-
How would I validate a file type? Zod has a way of doing custom types like so - colinhacks/zod#387 (comment) Is this possible in Valibot? J |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Sep 16, 2023
Replies: 2 comments 16 replies
-
In Valibot you can use |
Beta Was this translation helpful? Give feedback.
11 replies
-
Hello @fabian-hiller, sorry for bothering but how exactly to handle files? Tried with following schema and
but hitting tons of errors in console when apply this kind of validation to |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
mimeType
for the file type andmaxSize
for the maximum file size. You can find all other validation functions in our docs.