node.js - I would like to ask how nodejs stores images in mongodb
大家讲道理2017-06-17 09:15:33
0
4
897
The front-end uses vuejs, the back-end uses nodjs, and the database is mongodb. I would like to ask how to implement image uploading? Are images stored in mongodb in base64 format?
1. If you want to physically store images, it is best to use base64. 2. If it is a personal blog and you want to display pictures on the page, then it is best to find an image hosting, upload the pictures, and store the URL of the pictures in your DB
base64 is more convenient
Save the picture address. . .
Stored as an accessible address
1. If you want to physically store images, it is best to use base64.
2. If it is a personal blog and you want to display pictures on the page, then it is best to find an image hosting, upload the pictures, and store the URL of the pictures in your DB