Sending file (image/video) to trpc procedure

Hi anyone have a clue on how i can send an image/video to trpc procedure to upload it to google drive from there i tried to do it directly from front but since i need access to fs i couldnt if you have another way to save a video to google drive in nextjs i would love to know it
23 Replies
barry
barry2y ago
You don't
barry
barry2y ago
Idk how this would even work from the client lel But tRPC doesn't take files only serializable content
H
H2y ago
so we can't upload a video to the cloud using T3 stack xD ?
barry
barry2y ago
You can
H
H2y ago
how would you do it
barry
barry2y ago
Client -> tRPC -> AWS -> tRPC -> Client -> S3 Bucket trpc asks for a presigned url, gives it to the user, and the user sends it from their machine theres a guide on specifically t3+s3buckets and presigned urls you can look it up
H
H2y ago
found this im gonna read about it https://github.com/nramkissoon/t3-s3
GitHub
GitHub - nramkissoon/t3-s3: Example create-t3-app with AWS S3 presi...
Example create-t3-app with AWS S3 presigned URL integration - GitHub - nramkissoon/t3-s3: Example create-t3-app with AWS S3 presigned URL integration
Neto
Neto2y ago
currently trpc is using json or url encoded payloads so you can't send files
H
H2y ago
yea that what i found
Neto
Neto2y ago
but there is a rfc about using FormData as a transport mechanism
H
H2y ago
ugh honestly i don't think tRPC is ready for prod
Neto
Neto2y ago
why is that? lol
H
H2y ago
having to send a file in a base64 encode is not prod ready for me
Neto
Neto2y ago
how much of your job is sending files from the frontend?
Want results from more Discord servers?
Add your server