When working with js and JavaScript, I am attempting to utilize the Axios onUploadProgress
function in a way that it gradually progresses from 1% to 100%.
Below is the code snippet:
onUploadProgress: function(progressEvent) {
let percentage = (progressEvent.loaded * 100 / (progressEvent.total + 10000000));
percentage = parseInt(Math.round(percentage));
this.uploadPercentage[progress_index] = percentage;
}.bind(this)
The progress currently starts at 1%, then jumps straight to 2% and quickly reaches 100%. What I aim for is a smooth transition where it goes from 1% to 2%, then to 3%, and continues until reaching 100%. Any assistance on how to achieve this would be greatly appreciated.