Hi everyone, have spend the last few hours working...
# orm-help
s
Hi everyone, have spend the last few hours working with Prisma and it has been fun. But, I can't find any docs or tutorial on image/file uploads. My previous experience with database has been with Django, Postgres & a library called Pillow.
d
Hey @shahrukh ahmed What do you mean by image/file upload? You mean storing the file inside of the database, for example how we do when we work with SQL Server and store files in VarBinaries?
s
@Daniel Olavio FerreiraI was wondering if there was something like this. https://docs.djangoproject.com/en/3.2/ref/models/fields/#imagefield
d
s
Thanks. I will have a look. To explain, the filefield/imagefield in django, takes the uploaded image/file, places it in the folder name provided and then generated a URL for that file. @Daniel Olavio Ferreira.
d
I see, the bytes field is for you to store the file data (I think you can store it in base64) and then you can get it back and read directly in the front-end
To do exactly what you are looking for I think you would need a CDN like AWS S3
s
Thanks for the hint, still new to Node.js. 🙂
d
No worries, whenever you need
👍 1
r
As Daniel mentioned, I wouldn’t recommend storing blobs directly in the database, but using something like S3 or Cloudinary.
👍 1
s
Thanks guys. Found a few express tutorials that use multer, get the uploaded file's path and feed it into the db. Don't know if it's the right approach, but I have some understanding of how to proceed.