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...
S
santiago_28407175d 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...
N
Nick175d ago
Doesn’t look like you’re using the experimental form/file upload APIs? Vanilla trpc cannot transfer formats other than JSON
N
Nick175d ago
GitHub
GitHub - trpc/examples-next-formdata
Contribute to trpc/examples-next-formdata development by creating an account on GitHub.
S
santiago_28407175d 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
N
Nick175d ago
You can use a storage service to generate a URL or the experimental features
S
santiago_28407175d ago
but using a storage service will cost more eventually... isnt there a way to make a temporary storage url?
N
Nick175d 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
S
santiago_28407175d ago
Great thanks!!!
More Posts
`refetchOnWindowFocus` with RSC?Hi. Is there any way to have `refetchOnWindowFocus` work with server components? Seems like it onlyMulti useSubscription with trpc react -query integration failed to find second subusing trpc in nx monorepo, node version is 20 with yarn. backend is using trpc with express integratIs there any easy way to create a Type for a trpc routerI want to publish a set of trpc api client to npm, which will be used by my customer directly. But iTRPC with Nextjs 13 App RouterIm trying to implement TRPC with my already existing Nextjs 13 App to get typesafe API's. I've managSecurity: DDOS attack prevention for open endpoints tRPCSo we are building an application and got multiple trpc endpoints associated with it, some of them aIs there any information about caching in `@trpc/react-query`?How does query caching work? I want to create library for Angular and I would like to understand Reacache craziness?can someone sanity check something for me? i'm using sst + trpc + drizzleorm + aws + rds + postgretRPC over WebSocket with Next.js and NextAuthHi. I'm trying to set up Next 13 with tRPC over a WebSocket and NextAuth. I got it mostly working wiServer Side Calls in tRPC not working (Next 13, App Router)Where do I make the helper?Project structure ?I greatly appreciate for your insight on this, especially if you're an experienced fullstack dev: BAccess procedures with same names and same parameters, but in different routers, genericallyMy trpc structure looks something like this: ``` trpc - router1 - routerX - proc1 - rDisable trpc route cahce?```ts import { protectedProcedure, router } from "@/lib/trpc/server/trpc"; import { TRPCError } fromHow do you set headers or cookies in procedure ?Having trouble figuring out how to set headers within a procedure in Next 13.Why use unstable_httpBatchStreamLink in React server components?When using create-t3-app I noticed that they were using `unstable_httpBatchStreamLink` in their `TRPUnsafe return of an `any` typedI am using TRPC with Prisma. I can't seem to get rid of the TypeScript ESlint error. ``` import { zVanilla Client AuthenticationHow to authenticate using the vanilla client? I want to consume this route as the authenticated userGeneric Zod as Input TypeI'm not positive if this is a TRPC question, typescript in general, or failure to understand Zod in Incompatible Router TypesI am working on a trpc implementation for sveltekit. I attached a screenshot of the createContext nextjs app router, "fs", "os", "zlib-sync" and trpc experimental edge RouterEnvironement: Turborepo + pnpm What's wrong: when I tried to build nextjs, the error is like this TS4111: Property 'error' comes from an index signature, so it must be accessed with ['error'].I am trying to use trpc with AnalogJs, an Angular meta framework and Nx. We use the @nx/vite builder