Skip to main content

Posts

Showing posts from March, 2021

How to upload images in mongoDB with express js and multer

  Hi. welcome to another learning session on trycoder.com. Today, we are going to learn how to upload images in mongo database using express and multer middleware. This tutorial requires basic knowledge in express js and mongoose. If you are a total beginner, I recommend you check our past tutorials both on this website and our Youtube channel. Multer is a module used to upload files like images and other form of files using node js. There are equally other alternatives to multer like gridFS and the formidable module. Have you ever wondered how images are uploaded to the server or database? Lets figure it out!, When the images are submitted from the form on the front end, they need to be stored in a folder available in the server. The path to that file is then uploaded to the database which when called, will point out to the path and display the image like when adding images in html using a source path. If you got the point above, then you have gotten the whole idea. Let us look a ...