I know there are quite a few threads on this topic already, but unfortunately I didn\'t find my answer until now. I use angular.js with the example code from http://angular-js.i
If you are using express than you can use express-fileupload middleware to upload files.
const fileUpload = require('express-fileupload');
app.post('/upload', fileUpload, (req, res) => {
//Now you can use req.files.file to access the file input with name="file"
user.avatar = {data: req.files.file.data, contentType: req.files.file.mimetype};
//Now perform user.save
})