Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropzone.js upload progressbar doesn't work correctly

When I try to upload a big file, the progress bar becomes 100% instantly while in fact the file still in progress, and the progress bar waits as full until it finishes the upload progress. How could I make it as full when the upload progress finished.

enter image description here

It is waiting like this until it finishes the upload progress.

enter image description here

And this is when it finished

like image 402
Tolga Kısaoğulları Avatar asked Nov 16 '15 12:11

Tolga Kısaoğulları


1 Answers

Drop zone does not do the uploading progress calculation, you should do it yourself and provide the percentage to the drop zone component.

When you send an upload request trough http request, you can check file size to have the total size for uploading. Then on each response from your server (onData) check how much on the whole file size has been uploaded. Having total size and uploaded size you can set the uploaded percentage for Drop zone.

Also, there is a complete event which fires when the upload is successful or canceled due to an error.

like image 134
Besat Avatar answered Sep 19 '22 12:09

Besat