Validate FormData server action with input type="file"
Hello, I'm trying to validate input file on the server but the validation fails:
is it a normal behavior that server side its not a type File anymore ? client side validation does not trigger an error
5 Replies
deep-jadeOP•5mo ago
ok so server side its an empty object :/
deep-jadeOP•5mo ago
GitHub
FormData input type="file" returns an empty object in serverFn · I...
Which project does this relate to? Start Describe the bug Hello, trying to validate input file on the server but the validation fails because it returns an empty object issues: [ { kind: 'schem...
deep-jadeOP•5mo ago
oups, actually it works if I send the formdata and use formdata.get() on serverFn 🙂
So I guess I should close the issue maybe ?
optimistic-gold•5mo ago
deep-jadeOP•5mo ago
there is also https://github.com/fabian-hiller/decode-formdata
GitHub
GitHub - fabian-hiller/decode-formdata: Decodes complex FormData in...
Decodes complex FormData into a JavaScript object. Contribute to fabian-hiller/decode-formdata development by creating an account on GitHub.