Skip to content

Instantly share code, notes, and snippets.

View alvarosacari's full-sized avatar
🏠
Working at home

Alvaro Sacari alvarosacari

🏠
Working at home
View GitHub Profile
@alvarosacari
alvarosacari / upload.js
Created July 8, 2020 22:50 — forked from virolea/upload.js
Tracking file upload progress using axios
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])