I am using the below code to fire an event when the upload queue has completed, however i can not seem to get it working..
Any ideas?
var uploader = $("#uploader").pluploadQueue(
{
runtimes : 'html5,html4',
url : '/admin/media/image_upload',
max_file_size : '1mb',
unique_names : true,
filters : [{title : "Image files", extensions : "jpg,gif,png"}]
});
uploader.bind('FileUploaded', function(up, file, res)
{
alert('ok');
});
I don't know if this is relevant, but I use it slightly differently :
$("#uploader").pluploadQueue(
{
runtimes : 'html5,html4',
url : '/admin/media/image_upload',
max_file_size : '1mb',
unique_names : true,
filters : [{title : "Image files", extensions : "jpg,gif,png"}]
});
var uploader = $("#uploader").pluploadQueue();
uploader.bind('FileUploaded', function(up, file, res)
{
alert('ok');
});
You may like another way:
Additional property added to your $("#uploader").pluploadQueue() :
init: {
FileUploaded: function(up, file, info) {
// Called when file has finished uploading
console.log('[FileUploaded] File:', file, "Info:", info);
}
}
So the uploader code will be:
var uploader = $("#uploader").pluploadQueue(
{
runtimes : 'html5,html4',
url : '/admin/media/image_upload',
max_file_size : '1mb',
unique_names : true,
filters : [{title : "Image files", extensions : "jpg,gif,png"}],
init: {
FileUploaded: function(up, file, info) {
// Called when file has finished uploading
console.log('[FileUploaded] File:', file, "Info:", info);
}
}
});
I've found this in source examples - http://www.plupload.com/examples/events
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With