T
TanStack6mo ago
rare-sapphire

How to post multi-part form data in server fn?

I am posting a form on the client. You can see the image is what is captured before calling mutate using tanstack query. The request does not contain the file object because it defaults to request headers of content-type application/json How do we post multi-part form data with a server function?
No description
5 Replies
rare-sapphire
rare-sapphireOP6mo ago
This is the request generated from server fn
No description
frozen-sapphire
frozen-sapphire6mo ago
did you have a look at our tests?
frozen-sapphire
frozen-sapphire6mo ago
GitHub
router/e2e/react-start/server-functions/src/routes/submit-post-form...
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
frozen-sapphire
frozen-sapphire6mo ago
if that does not help, please provide a complete minimal example
rare-sapphire
rare-sapphireOP6mo ago
Ah didn't see that thanks for pointing me in the right direction. Will try to get it working from here

Did you find this page helpful?