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
trpc only does json
no files
So how to solve it then?
i dont know tbh
i just know trpc doesnt do files
what do you want to do with the file?
Currently , Send to backend , Process the input , Upload that cover image to google drive & store its url to my mysql db
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•3y ago
Message Not Public
Sign In & Join Server To View
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
OKay
Thanks
seems fine for image manipulation
Do you know any way to decode the encoded file properly? I couldn't find any solution .