How To Track The Download Percentage Using Jquery/javascript?
I want to have a progress bar in my page that has an action of DOWNLOAD. In file upload it is possible but in download is it possible also? Can you give me some good reference for
Solution 1:
You can use the progress bar as part of JQuery UI An example is on that page of how to use it for downloads.
Solution 2:
Try this: LINK
Stack over flow QN link
This part of the code basically provides the percentile functionality for the value you need for the progress bar.
// progress on transfers from the server to the client (downloads)functionupdateProgress (oEvent) {
if (oEvent.lengthComputable) {
var percentComplete = oEvent.loaded / oEvent.total;
// ...
} else {
// Unable to compute progress information since the total size is unknown
}
}
XMLHttpRequest provides the ability to listen to various events that can occur while the request is being processed. This includes periodic progress notifications, error notifications, and so forth.
Post a Comment for "How To Track The Download Percentage Using Jquery/javascript?"