When uploading a file using node JS and expanding Multer returns error:
code: "EACCES"
errno: -13
path: "directory/filename.txt"
storageErrors: []
syscall: "open"
Storage:
const storage = multer.diskStorage({
destination: function(req, file, cb) {
cb(null, './files/')
},
filename: function(req, file, cb) {
cb(null, Date.now() + "_" + file.originalname.split(" ").join(""))
}
});
I think this is due to the fact that there is no user access to the directory on the server, but I can't find a solution to solve it.