T
tRPC

How to upload file not use S3 Next js? Please, example

How to upload file not use S3 Next js? Please, example

IIgor_lviv5/10/2023
file: course.router.ts / import { CourseSchema } from "~/schema/post.schema"; import { createTRPCRouter, publicProcedure, protectedProcedure, } from "~/server/api/trpc"; import formidable from "formidable"; import fs from "npm"; export const courseRouter = createTRPCRouter({ create: protectedProcedure.input(CourseSchema).mutation(({ ctx, input }) => { //upload and save here input.file //// // throw new TRPCError({ code: "INTERNAL_SERVER_ERROR" }); return ctx.prisma.curse.create({ data: { name: input.name, video: input.video, descriptionCurse: input.descriptionCurse, }, }); }), });
Yygorperez5/10/2023
this video might help you out: https://youtu.be/mxT3j-5s1Zc

Looking for more? Join the community!

T
tRPC

How to upload file not use S3 Next js? Please, example

Join Server