Hi been having problems with this, and cant work out how to refresh the uploader.
i have an admin interface where certain panels display are set to hidden and shown using $(#myid').show
after showing a div with the uploader (i am showing and hiding a div that contains the div with the uploader)
the code for my show/hide button
$('#uploadBtn').click(function(){
$('.admin_button').removeClass('btnOn')
$(this).addClass('btnOn')
$('#fileList').hide();
$('#appList').hide();
$('#flvGallery').hide();
$('#uploadArea').show();
var uploader = $('#uploader').plupload
uploader.refresh() //dont work
});
the code for my uploader:
$("#uploader").plupload({
// General settings
runtimes : 'flash,html5,browserplus,flash,silverlight,gears,html4',
url : 'process upload.php',
max_file_size : '150mb',
chunk_size : '1mb',
unique_names : true,
multiple_queues : true,
// Resize images on clientside if we can
//resize : {width : 320, height : 240, quality : 90},
// Specify what files to browse for
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip,avi"}
],
// Flash settings
flash_swf_url : '../plupload/js/plupload.flash.swf',
// Silverlight settings
silverlight_xap_url : '../plupload/src/javascript/plupload.silverlight.xap'
});
// Client side form validation
$('form').submit(function(e) {
var uploader = $('#uploader').plupload('getUploader');
// Validate number of uploaded files
if (uploader.total.uploaded == 0) {
// Files in queue upload them first
if (uploader.files.length > 0) {
// When all files are uploaded submit form
uploader.bind('UploadProgress', function() {
if (uploader.total.uploaded == uploader.files.length)
$('form').submit();
});
uploader.start();
} else
alert('You must at least upload one file.');
e.preventDefault();
}
});
my html:
<div id="uploadArea" style="display: none">
<form method="post" action="">
<div id="uploader ">
<p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
</div>
</form>
</div>
any help greatly appreciated