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

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:, video:, descriptionCurse: input.descriptionCurse, }, }); }), });
ygor perez
ygor perez376d ago
this video might help you out:
Theo - t3․gg
I Fixed File Uploading.
CHECK OUT UPLOADTHING We were tired of AWS's offerings with S3, and we weren't satisfied by what Cloudflare offered with R2 or even Vercel's Blob offering. I think we have something special here. GIVE MARK SOME LOVE FOR DEALING WITH MY BS ALL MY VIDEOS ARE POSTED EARLY ON PATREON https://ww...
Rasel Hossain
Rasel Hossain20d ago
did you find any solution?
Bruno M.
Bruno M.18d ago
I recommend using a service like AWS or Cloudflare R2. I've made a very simple example of how you can do this: .
GitHub Gist: instantly share code, notes, and snippets.