jquery - Plupload connection between multipart=true and showing upload percentage -


seems plupload great tool. i'm stuck in simple problem here. have set multipart = false (i don't want send data in chunks), however, want show percentage uploaded. shows no % uploaded , shows 100% @ end of upload. here code.

 $(function() {         var pluploader = new plupload.uploader({             runtimes : 'flash', //flash,gears,flash,silverlight,browserplus,html5             browse_button : 'img_video_upload',             container : 'video_upload_container',             max_file_size : '3gb',             //chunk_size : '100kb',             multipart : false,             multiple_queues : false,             multi_selection: false,             url : 'url('*/*/videoupload')?>',             flash_swf_url : '/public/js/plupload/js/plupload.flash.swf',             filters : [                 {title : "video file", extensions : "flv"}             ]         });          pluploader.init();          pluploader.bind('filesadded', function(up, files) {             $('#panelwraperror').remove();             pluploader.start(); //start file upload         });          pluploader.bind('uploadprogress', function(up, file) {             $('#upload_progress').html('progress: ' + file.name + ' ' + file.percent + '% uploaded ' + "
"); }); pluploader.bind('fileuploaded', function(up, file, ret) { var response = eval('(' + ret.response + ')'); //hide upload progress div //$('#upload_progress').hide(); if(response.success){ $('#uploadresultwithtime').html('your video uploaded. please view preview.' + '
video length: ' + response.duration + ' seconds' + '
video size: ' + response.size + ' kb' ); } if(response.error){ $('#uploadresultwithtime').html(response.message); } }); pluploader.bind('error', function(up, err) { $('#panelwrap').prepend('
  • ' + err.message +'
'); }); });

you have set "flash" runtime. plupload doesn't have way of knowing upload progress when using flash runtime , not using chunked uploads.

you either have accept no progress indication using flash , activate other runtimes (html5, gears etc.) work, or activate chunked uploads makes flash able tell how many chunks of total amount of chunks has uploaded.

that means if have 1mb file upload , chunk_size set 100kb, flash able show 10,20,30 - 100 % (a step @ each chunk.)

try set following in plupload options optimal support.

runtimes : "gears,flash,silverlight,browserplus,html5", chunk_size : '100kb'

remember server needs support receiving chunked uploads.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -