T
tRPC

it sound like handle upload/download file need build new http server or endpoint?

it sound like handle upload/download file need build new http server or endpoint?

Bbingcoke10/2/2023
I have scan all posts i can about solution for handle upload/download file with trpc.So there is no great solution for this with trpc for now? If no, i can only build new nestjs server to handle files specially but i need implement permission management again and can't reuse middleware that used in trpc. By the way, trpc is a Wonderful project for ts full stack developer!
Solution:
not sure what you're using for file storage. we use S3 Buckets on our project and we have our tRPC endpoitn generate a pre-signed URL for S3 Uploads that gets sent to the frontend, and the file is uploaded directly from client to S3 downloads work similarly where we can generate presigned url's if the bucket is not public, or just give them the public link if it is...
Jump to solution
Solution
Hhaardik10/2/2023
not sure what you're using for file storage. we use S3 Buckets on our project and we have our tRPC endpoitn generate a pre-signed URL for S3 Uploads that gets sent to the frontend, and the file is uploaded directly from client to S3 downloads work similarly where we can generate presigned url's if the bucket is not public, or just give them the public link if it is
AAqeu10/2/2023
Exactly what @haardik said, but if you're using Next you can make an Next api endpoint to upload your file and with the help of createcaller or on client, use trpc to save the url from that upload
Bbingcoke10/3/2023
thanks bro!this is an excellent way i am creating a react native app so you know.but thanks for your suggestion,when i build a web application i will try it

Looking for more? Join the community!

T
tRPC

it sound like handle upload/download file need build new http server or endpoint?

Join Server
Recommended Posts
tRPC queries running on the serverEnvironment: - bun 1.0.2 - next 13.4.16 - trpc 10.37.1 I am creating an app with `next-intl` and `nAutomatically setting input for requests via OpenAPIMy API allows users to authenticate via OpenAPI with an API key. The context either has `ctx.user` (Name recommendations for my api endpoints that use swagger, trpc-panel, trpc-playground.What name do you recommend for each one, in addition to the rest api and the trpc api endpoints. LiIn the context should I put all my dependencies for my endpoint handlers?For example I have the end point 'getStuff` In this endpoint the handler call 3 party apis and map Basic Inference not WorkingI have been struggling to get basic type inferencing to work with trpc, react, and Drizzle ORM. ThitRPC Websockets with a standalone Bun Server?Hey folks! Experiementing with setting up a standalone tRPC Server using Bun. The HTTP part is greaInfinite session query when tab is in backgroundSo, when I am in development mode, doing some changes in my code and my application's tab is not in How to return a stream? like open ai apiI want that my api can have stream responses like open ai https://github.com/openai/openai-node#strewas wondering if anyone got a chance to use Ajv as input/output validator?I have been trying to use Ajv https://ajv.js.org/ with tRPC, but I wasn't able to get the types workstate change does not refetch the query and the app freezeshttps://github.com/trpc/trpc/discussions/4856 I am not sure if linking is allowed but I opened a diI have an api with trpc, how can I consume it from dart/flutter?https://flutter.dev/ https://dart.dev/ Thankstrpc subscription with react-queryTRPCClientError: Subscriptions should use wsLink having error when use subscription with react-querUnable to get mutation to trigger subscription because EventEmitter not being sharedHey folks, Been struggling with this for a few hours now hopelessly and trying random things - readIs there a guide of how to test?I'm usually use vitest but in frontend of shared packages. I'm frontend trying to create my first a