1upload(files) {
2 const config = {
3 onUploadProgress: function(progressEvent) {
4 var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
5 console.log(percentCompleted)
6 }
7 }
8
9 let data = new FormData()
10 data.append('file', files[0])
11
12 axios.put('/endpoint/url', data, config)
13 .then(res => console.log(res))
14 .catch(err => console.log(err))
15}