picEdit icon indicating copy to clipboard operation
picEdit copied to clipboard

Progress indicator on upload

Open simonpapworth6742 opened this issue 10 years ago • 1 comments

I have changed request.onprogress in the _formsubmit to give a working progress user comfort.

                //send request
                var request = new XMLHttpRequest();
                request.upload.onprogress = function (e) {
                    if(e.lengthComputable) var total = e.total;
                    else var total = Math.ceil(inputblob.size * 1.3);
                    var progress = Math.ceil(((e.loaded)/total)*100);
                    if (progress > 100) progress = 100;
                    _this.set_messagebox("Please Wait... Uploading... " + progress + "% Uploaded.", false, false);
                };

Sorry, I don't yet know how to use github!

simonpapworth6742 avatar Feb 04 '15 18:02 simonpapworth6742

Thanks. I'm using it. Works great! It's important when uploading large files so the user knows that the server is actually doing something ;-)

jaysudo avatar Mar 03 '15 01:03 jaysudo