shadcn's form with uploadthing sdk

I am trying to upload an image to UploadThing through the SDK inside a server action. But I'm not sure how to fulfill the uploadFiles parameters because I'm not receiving a FormData from the form. My idea was to parse the image to base64 before sending to the server and then uploading it (that's what I usually do in my local projects) but I actually don't know how to pass base64 to be uploaded.
5 Replies
andreas_15
andreas_158mo ago
Were you able to fix this?
peterkyle01
peterkyle018mo ago
Do you have your schema with image as type of file and are you using controlled components provided by react hook form to get the file data and pass it to shadcn form data
Fagner
FagnerOP8mo ago
I didn't find a way to fix this, so I drop the support for passing files and I'm using URLs for now.
Alex
Alex8mo ago
GitHub
what-do-we-eat/src/components/upsert-food.tsx at main · alex289/wha...
Web app to tell you what to eat. Contribute to alex289/what-do-we-eat development by creating an account on GitHub.
Alex
Alex8mo ago
It’s not using server actions but maybe it could be converted easily
Want results from more Discord servers?
Add your server