Wednesday 31 January 2018

Am I using Multer correctly?

I'm using Multer to upload images. var newsSchema = new mongoose.Schema({ title : String, body: String, image : String //the name of the image } Multer uploads files in an "Uploads" directory, as expected and I store the name of the image in MongoDB, and I use it on my page.I've seen many tutorials on the internet, and what they've done is use fs to store the image in MongoDB. But wouldn't that double space consumption, since the same image is stored in "uploads" directory, and then in a MongoDB document?How should I be doing it?Thanks!

Submitted January 31, 2018 at 08:05AM by epic_within

No comments:

Post a Comment