0

So, I have following form for my wordpress site:

<form name="upload_video" method="post" enctype="multipart/form-data">  
    <input type="file" name="files[]" class="files" onchange="UploadImage(event);"/>        
    <p id="append_image">
       <div class="append_image"></div>
    </p>    
    <input type="button" class="submit_form" value="submit">
</form>

and I have following function (a part of) to display the image:

function UploadImage(e)
{   
    formdata.append('action', 'UploadImage');
    jQuery.ajax({       
        ////
        ////omitted
        //// 
        beforeSend : function(){
            jQuery('#append_image').html('Uploading...');
        },
        success : function(data){
            jQuery('#append_image').html('');           
        }           
        }
    });
}

In this current set up, when an image is selected, it shows "uploading..." in the id="append_image" section. Upon completion, it disappears as you can see from the function above.

However I want to change "Uploading..." into a progress bar with percentage shown. Does anyone know how I can do that?

Thanks!

Ash
  • 2,108
  • 2
  • 17
  • 22
Steve Kim
  • 5,293
  • 16
  • 54
  • 99
  • Which library are you using ? Check blueimp file upload, they provide simple API for single & multiple file upload. – Manish Kumar Oct 30 '15 at 08:45
  • Possible duplicate of [Can onprogress functionality be added to jQuery.ajax() by using xhrFields?](http://stackoverflow.com/questions/15668339/can-onprogress-functionality-be-added-to-jquery-ajax-by-using-xhrfields) – Amit Oct 30 '15 at 08:47

0 Answers0