vue-axios, why event.loaded = event.total when the request fails , then there is no way to calculate the real-time progress bar
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
let config = {
onUploadProgress: (progressEvent: any) => {
console.log(progressEvent.loaded);
console.log(progressEvent);
this.progress =
(((progressEvent.loaded / progressEvent.total) * 100) | 0) + "%";
console.log(this.progress);
}
}; /* */
Axios.post(`/carrots-admin-ajax/a/u/img/task`, form, config)
.then(res => {
console.log(res);
let message = res.data.message;
this.uploadInfo(this.files);
/* */
})
.catch(function() {
console.log("FAILURE!!");
}); /* */
} /* HTTP */
what result do you expect? What is the error message actually seen?
Boss, who is familiar with the progress incident? I"d like to ask,
Why is loaded in the progress event the same as total when the request fails? In this way, there is no way to realize the real-time progress bar.
as you can see, my request here obviously failed, but loaded is still equal to total.
which boss can help solve the problem, thank you very much!