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
barry2y ago
trpc only does json no files
Pluto
Pluto2y ago
So how to solve it then?
barry
barry2y ago
i dont know tbh i just know trpc doesnt do files
Neto
Neto2y ago
what do you want to do with the file?
Pluto
Pluto2y ago
Currently , Send to backend , Process the input , Upload that cover image to google drive & store its url to my mysql db
Neto
Neto2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
bennettdev
bennettdev2y 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
Pluto2y ago
OKay Thanks
barry
barry2y ago
seems fine for image manipulation
Pluto
Pluto2y 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