Welcome Guest, Not a member yet? Register   Sign In
Progress Bar when file upload
#1

[eluser]yannyannyann[/eluser]
Hello

I have a jquery ajax upload system that works well.
However as I am uploading big files I would like to display a progress bar, or a simple percentage value, for the user to see that the upload didn't crash.

How could I implement that in my code ?

Code:
jQuery("#addVideoForm").validate({
        rules: {
            userfile: {
                  required: true,
                accept: "mov|avi|mpg|flv"
            }
        },
        submitHandler: function(form) {
            jQuery(form).ajaxSubmit({
                target:        '#positive-result',  
                beforeSubmit:  showRequest,
                success:       showResponse  
            });
        }
    function showRequest(formData, jqForm, options) {
        $('#result').fadeIn("slow");            
        $('#positive-result').html("Uploading...");
        var queryString = $.param(formData);
        return true;
    }

    function showResponse(responseText, statusText)  {    
        
        $('#positive-result').html( 'Video added.');
        $('#result').fadeIn("slow");    
    }
    });
#2

[eluser]Colin Williams[/eluser]
You essentially need to iteratively monitor the size of the uploading file on the server file system and compare it to the total size of the file.
#3

[eluser]TheFuzzy0ne[/eluser]
To my understanding, this takes special configuration of the server, using the apc_fetch() or uploadprogress_get_info() functions available in the PECL extension.
#4

[eluser]yannyannyann[/eluser]
yeah i can't configure APC :-(
#5

[eluser]pistolPete[/eluser]
You could use a flash based uploader, e.g. swfupload.org.




Theme © iAndrew 2016 - Forum software by © MyBB