0👍
It seems you did not send the formData
and sent this.file
instead on the axios call.
This is what you worte in your post:
axios
.post("http://localhost:3000/poste", this.file)
This is what to do:
axios
.post("http://localhost:3000/poste", formData)
[UPDATE]
It alse seems you should do formData.append('image', this.file)
because on the backend you used "image" as filename:
module.exports = multer({ storage: storage }).single("image");
- [Vuejs]-How to call function from Vue.js to HTML page
- [Vuejs]-Vue.js Documentation Example Not working in Codepen?
Source:stackexchange.com