Next.js Discord

Discord Forum

Do server actions support files without FormData now?

Unanswered
Florian posted this in #help-forum
Open in Discord
Avatar
In the past, I had to wrap files sent to server actions into FormData. It seems this is not necessary anymore. Can anyone confirm this?

5 Replies

Avatar
No I don't think so, you may still need FormData to receive files?
Avatar
Hm I thought I sent the normal values but maybe I was still sending FormData. I don't have the code right now.
Avatar
No I think the file is in the resolved values (without FormData)
Image
Avatar
can you show me your codebase?
Avatar
The code is not public right now but it's just a server action called from a client component with some data (including in image file) coming from Hook Form/Zod