-1

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

harish chava
  • 252
  • 2
  • 19

1 Answers1

2

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.

barbakini
  • 3,024
  • 2
  • 19
  • 25