js axios progress
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
axios.put('/endpoint/url', data, config)
.then(res => console.log(res))
.catch(err => console.log(err))
}
Also in JavaScript:
- Javascript format date / time
- useeffect umnount
- jquery on body click
- discord.js dm user
- how to unselect input javascript
- how can auto download window print in javascript
- store data in localstorage chrome as per address bar url using javascript
- vuejs remove object from array
- how to numeric value is after point 2 values in javascript
- javascript convert in a string the items of an array
- como criar uam seessão com jsp
- how to add multiple styles in javascript
- javascript automatic click
- command reboot android app react native adb command
- onPress image react native
- const{}=
- setimteout use function generator
- How to get row index and cellindex together in javascript
- mongoose connection nodejs
- try catch javascript
- json file example
- discord.js set playing tag
- javascript print
- template literal syntax' is only available in ES6 (use 'esversion: 6'). (W119)jshint(W119)