Это путь:
let data = new FormData();
data.append('foo', 'bar');
data.append('file', document.getElementById('file').files[0]);
let config = {
onUploadProgress: function(progressEvent) {
let percentCompleted = Math.round( (progressEvent.loaded * 100) / progressEvent.total );
}
};
axios.put('/upload/server', data, config)
.then(function (res) {
output.className = 'container';
output.innerHTML = res.data;
})
.catch(function (err) {
output.className = 'container text-danger';
output.innerHTML = err.message;
});
Надеюсь, это поможет!