I am using filestack client
to upload images to S3 bucket
. I want to show progress bar while uploading. When I upload any image of almost more than 1MB the progress bar progresses in desired way, means, progress bar moves from 0% to 100% very smoothly.
But when I try to upload any small file(image) of like some KBs the progress bar jumps directly from 0% to 100% in zero time.
In upload options I tried smallest value of 1 Milli Second for property progressInterval
but not luck.
Here is my code:
let uploadOptions = {
progressInterval: 1,
onProgress: (e) => {
$('.thumbnail-container .thumbnail .progress-container .progress').css('width', e.totalPercent+'%');
$('.thumbnail-container .thumbnail .progress-container p.percentage').html(e.totalPercent+'%');
},
}
let storeOptions = {
"access": "public",
"path": temp_path+'/'+file.name+'.'+fextension
}
client.upload(file, uploadOptions, storeOptions)
.then(res => {
console.log(res);
});
I want progress bar to move smoothly, from 0 to 100 in a linear way.