Hey all,
I’m trying to teach myself the MEAN stack and Hyperdev has become my best friend along the way!
I’m currently trying to create a form that allows me to upload a file(image) and then save it to my MongoDB. I’m using multer, but no matter what destination I put for storage I get this error:
"error: EROFS: read-only file system, open ‘assets/1d19426b73718f34b29a0a29b82283ec’
_ at Error (native)"_
My current code:
var multer = require('multer');
var upload = multer({dest: './assets'});
app.post('/newproduct', upload.single('image'), function (req, res, next) {
console.log(req.files);
// req.files is array of `photos` files
// req.body will contain the text fields, if there were any
});