I am using VueJs / axios in frontend and multer in nodejs for a simple file upload to work.
So far all tries has been unsuccessful. While this can be achieved in 1
You can use FormData for that and it is pretty easy.
Let me show you an example:
// html
// js
methods: {
upload () {
let files = this.$refs.uploadBtn.files
let formData = new FormData()
// if you want to upload multiple files at once loop
// through the array of files
formData.append('attachment', files[0])
axios.post(url, formData).then(response => ...)
}
}
This should do the trick and you don't really need a 3rd party plugin for that.