harish chava
harish chava

Reputation: 252

Best method suited to store and display small image in mongo database

how to store small images (< 2 MB)in mongodb and display the image on webpage without downloading it?

Upvotes: -1

Views: 1078

Answers (1)

barbakini
barbakini

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

Related Questions