The end user is supposed to upload through a file browser an excel file:
Passing a file to the backend is done via multipart/form-data
forms.
If you inspect the request that you send to the backend right now, you will see that your request does not send ( probably ) a multipart/form-data
.
You can check for reference What does enctype='multipart/form-data' mean? question.
Your code should look something like :
callUploadXLS: {
remote( state, file ) {
// ^ make sure that `file` here is the same target.files[0]. It should be `File` Object
// Will turn your form to `multipart/form-data`
var data = new FormData();
data.append('file', file);
const url = `${base}/vendor/form`;
return $http.instance.api.post( url, data );
},
success: Actions.XLSUploaded,
error: Actions.fail
}