moxiecode/plupload — Issue #422: Automatically start upload when files added
Author: mabid
Created: 2011-11-15 13:38:44+00:00
State: open

When files are added i want to start the upload process automatically. I called the start function at the end of FilesAdded but it doesn't start the upload.

uploader.bind('FilesAdded', function(up, files) {
var str = "";
for (var i in files) {
str += '

' + files[i].name + ' (' + plupload.formatSize(files[i].size) + ')

';
}
$('#filelist').html(str);
up.refresh();
up.start();
});

Here is my creation code

var uploader = new plupload.Uploader({
runtimes: 'html5,flash,silverlight',
autostart : true,
url: '<%= images_path %>',
max_file_size: '10mb',
multipart: true,
browse_button: "pickfiles",
container: "the-uploader",
drop_element : "drop-area",
multipart_params: {
'_http_accept': 'application/javascript',
'<%=request_forgery_protection_token%>': '<%=form_authenticity_token%>',
'<%=request.session_options[:key]%>': '<%=request.session_options[:id]%>'
},
filters: [
{title: "Images", extensions: "avi,jpg,jpeg,png,zip"}
],
});