the front end requests to report 404, but the backend confirms that the file can be received
Code in node service server.js
var storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, "./upload");
},
filename: function (req, file, cb) {
let pointIndex = file.originalname.indexOf(".")
let name = file.originalname.slice(0, pointIndex)
let filename = file.originalname.slice(pointIndex)
cb(null, name + "-" + (Math.random() * 100000000000000000) + filename);
}
})
var upload = multer({
storage: storage
})
router.post("/upload", upload.array("file[]", 9), function (err, req, res, next) {
console.log(err)
res.send({
code: 200,
msg: ""
})
})