node.js - I would like to ask how nodejs stores images in mongodb
大家讲道理2017-06-17 09:15:33
0
4
739
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?
base64 比较方便
存图片地址呀。。。
存储为可访问的地址
1、如果是想物理存储图片,最好是base64。
2、如果是个人blog类的,想要在页面上显示图片,那么最好是找一个图片托管,把图片上传了,在你的DB中存储图片的url