I need to store images in my DB, and I'd like to b...
# orm-help
s
I need to store images in my DB, and I'd like to be able to query their urls. is there a recommended way to do this using prisma? I couldn't find any info on this in the docs, unfortunately
d
Prisma is not a file storage system. If it's a hard requirement for you, it's probably possible to do something like storing the encoded image as string and your frontend server catches all routes on ../images/<image_id> and queries the underlying data for the image string. I would, however, recommend putting images on S3, for example, and just storing management details in Prisma, like name / url.
s
understood. I have the database running on heroku, so I'll stick with that
a
Depending on what images you have you probably want to set up scaling and compression too. If you want this ready made you can use imgix.com, there are also open source alternatives. I would also recommend storing images in s3 with Metadata in your database
s
thanks. I'm looking to store FB messenger-codes in the DB, but I need to do some image processing (replacing avatars) beforehand. so I'll probably need to do something more custom.. 🙂