Uploading Files in T3-Stack

I have a question , I got a project from someone that used T3-Stack to upload files to the database but he made a big mistake and uploaded base64 to the database ( postgres with prisma ) but I want to upload multiple files to the server instead of uploading it via base64, how can i achieve this , I tried to find a way to use multer but I cannot please I need help also can I convert base64 files from database and save it as a string values and then fetch it with next js frontend ? please explain like I am a noob because its my first time using T3-Stack and everything is confusing to me
6 Replies
Arctic
Arctic10mo ago
I would recommend a file storage solution like uploadthing or AWS S3 which is what upload thing uses behind the scenes. Relational databases are not really meant to store file information
om3r
om3r10mo ago
yea i heard about uploadthing but can i upload it locally on the server , something like multer ?
Arctic
Arctic10mo ago
MinIO
MinIO | High Performance, Kubernetes Native Object Storage
MinIO's High Performance Object Storage is Open Source, Amazon S3 compatible, Kubernetes Native and is designed for cloud native workloads like AI.
Arctic
Arctic10mo ago
Not sure if it will help or not but that was a similar ish question
Snow
Snow10mo ago
Theoretically, you could probably just use the standard file system and write to disk. But if you ever have plans of moving to any hosting you will have to use something like AWS S3. Their free plan should be more than enough because as soon as you move to something like Vercel, they will not have a filesystem.
om3r
om3r10mo ago
I was going to deploy the app on a vps but I wanted to store the files inside the server folder so I can access it easily later , but vps has like 1TB storage
Want results from more Discord servers?
Add your server
More Posts