Reputation: 252
how to store small images (< 2 MB)in mongodb and display the image on webpage without downloading it?
Upvotes: -1
Views: 1078
Reputation: 3154
You can save it as base64 image. Base64 images is represented as string. So you can easily save and retrieve it. You will encode(in front-end) and save images as string. When you retrieve it to your front-end, you will decode and display it.
Upvotes: 2