santiago_28407
santiago_2840715mo ago

TRPC File as Input

Stack Overflow
NextJS TRPC File as Input
I am making a web app using NextJS with TRPC. In my app I have a form that asks to select a File. What I need to do is pass the file a trpc call so I can do all the file logic in the backend and no...
8 Replies
santiago_28407
santiago_28407OP15mo ago
Stack Overflow
trpc to upload file
I am making a web app using NextJS with TRPC. In my app I have a form that asks to select a File. What I need to do is pass the file a trpc call so I can do all the file logic in the backend and no...
Nick
Nick15mo ago
Doesn’t look like you’re using the experimental form/file upload APIs? Vanilla trpc cannot transfer formats other than JSON
Nick
Nick15mo ago
GitHub
GitHub - trpc/examples-next-formdata
Contribute to trpc/examples-next-formdata development by creating an account on GitHub.
santiago_28407
santiago_28407OP15mo ago
Thanks, is there any way to handle a file without using experimental features? maybe i can handle the file inside the client component? What i want is to select a file and using langchain extract all the chunks but i dont want to upload the file to a storage database becouse i will not use it
Nick
Nick15mo ago
You can use a storage service to generate a URL or the experimental features
santiago_28407
santiago_28407OP15mo ago
but using a storage service will cost more eventually... isnt there a way to make a temporary storage url?
Nick
Nick15mo ago
S3 can have rules to delete files automatically, you’ll also be paying for connection bandwidth/time usually so might find it works out cheaper even
santiago_28407
santiago_28407OP15mo ago
Great thanks!!!

Did you find this page helpful?