Pls how can i put a counting progress bar??

17 views
Skip to first unread message

nnamdi osu

unread,
Aug 16, 2016, 3:55:58 AM8/16/16
to jQuery-File-Upload
Hi wonderful people. pls i need some help. i've gotten the plugin for the jquery upload and its working fine. the only challenge is i need the bar to be counting e.g 10%, 11%, ...... when uploading. please find my code for the upload below



 <script>


$(function () {
    'use strict';
    // Change this to the location of your server-side upload handler:
    var url = window.location.hostname === 'clive.org' ?
                '//http://tripplegee.ng/admin/' : 'server/php/';
    $('#fileupload').fileupload({
        url: url,
        dataType: 'json',
        done: function (e, data) {
            $.each(data.result.files, function (index, file) {
                $('<p/>').text(file.name).appendTo('#files');
                $('#img_name').val(file.name);
            });
        },
        progressall: function (e, data) {
            var progress = parseInt(data.loaded / data.total * 100, 10);
            $('#progress .progress-bar').css(
                'width',
                progress + '%'
            );
        }
    }).prop('disabled', !$.support.fileInput)
        .parent().addClass($.support.fileInput ? undefined : 'disabled');
});
</script>


i know its some where around the above code but i dont know where. pls help. thanks
Reply all
Reply to author
Forward
0 new messages