Unable to send file to backend in trpc

Hi. Im trying to send files to backend using formik , trpc but not recieving those files object in my procedure . Does anyone know solution?
11 Replies
barry
barry3y ago
trpc only does json no files
Pluto
PlutoOP3y ago
So how to solve it then?
barry
barry3y ago
i dont know tbh i just know trpc doesnt do files
Neto
Neto3y ago
what do you want to do with the file?
Pluto
PlutoOP3y ago
Currently , Send to backend , Process the input , Upload that cover image to google drive & store its url to my mysql db
Neto
Neto3y ago
you should not send files to lambdas can create an upload url, upload on client and have a valid link to store in the db
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
bennettdev
bennettdev3y ago
Some options: - Use presigned URLs if possible - Base64-encode your file, send it via tRPC, decode on the server - Use a native Next.js API and handle multipart/form-data yourself
Pluto
PlutoOP3y ago
OKay Thanks
barry
barry3y ago
seems fine for image manipulation
Pluto
PlutoOP3y ago
Do you know any way to decode the encoded file properly? I couldn't find any solution .
Want results from more Discord servers?
Add your server