How can we store blob data? #21689
QuestionIs there any way to store a blop data ? is there any data type? How to reproduce (optional)Expected behavior (optional)No response Information about Prisma Schema, Client Queries and Environment (optional)// Add your schema.prisma// Add any relevant Prisma Client queries here
|
Replies: 2 comments 1 reply
|
Hi @BotBuddies 👋 Thank you for raising this question. It’s usually a good practice to store Images or videos in a Blob Storage and images or videos should not directly be stored in the database, so you can use something like AWS S3 or Cloudinary to store the image/video and store the bucket path in your database. Here’s a working example of how you could achieve it. If this answers your question, it would be great if you could mark this Discussion as answered to indicate that it has been resolved. Otherwise please let us know how else we can help you further or close the Discussion if it was resolved in some other way 🙏 |
|
There is a
Please note however, that it is not usually advisable to store bytes directly in the database, especially if there will be a lot of them. For bulk storage, an S3-compatible storage API would usually be preferable. |
Hi @BotBuddies 👋
Thank you for raising this question.
It’s usually a good practice to store Images or videos in a Blob Storage and images or videos should not directly be stored in the database, so you can use something like AWS S3 or Cloudinary to store the image/video and store the bucket path in your database.
Here’s a working example of how you could achieve it.
If this answers your question, it would be great if you could mark this Discussion as answered to indicate that it has been resolved.
Otherwise please let us know how else we can help you further or close the Discussion if it was resolved in some other way 🙏