Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am very new to jquery. I got a requirement where i need to upload multiple image files using jquery with progress bar. i googled it found the solution, but i could'nt understand the jquery script. So can any one explain me the logic.

Link :- Upload multiple file in asp.net using jquery

Code:-
JavaScript
$(document).ready(function () {
            $("#btnUpload").click(function (evt) {
                /* variables */
                var status = $('.status');
                var percent = $('.percent');
                var bar = $('.bar');
                $('form').ajaxForm({
                    url: "FileUploadHandler.ashx",
                    type: "POST",
                    /* reset before submitting */
                    beforeSend: function () {
                        status.fadeOut();
                        bar.width('0%');
                        percent.html('0%');
                    },
 
                    /* progress bar call back*/
                    uploadProgress: function (event, position, total, percentComplete) {
                        var pVel = percentComplete + '%';
                        bar.width(pVel);
                        percent.html(pVel);
                    },
 
                    /* complete call back */
                    complete: function (data) {
                        status.html(data.responseText).fadeIn().fadeOut(1600); 
 
                    }
 
                });
 
            });
        });
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900