This question was already answered here and here. But with version 1.5.6 placing init() before FilesAdded(...) makes it totally unresponsive. As well autostart uploading does not start at all either way.
var csvUploader = new function() {
var self = this;
self.init = function() {
var uploader = new plupload.Uploader(
{
runtimes: 'html4',
url: 'http://localhost:5073/Document/Upload',
browse_button: 'uploadCsvButton',
max_file_size: '100mb',
chunk_size: '1mb',
unique_names: true,
filters: [{ title: "CSV files", extensions: "csv" }]
});
/* postion 1: uploader.init(); /**/
uploader.bind('FilesAdded', function(up, files) {
setTimeout(function () { up.start(); }, 500);
});
uploader.bind('FileUploaded', function (up, file) {
// do some stuff here...
});
/*position 2: */ uploader.init(); /**/
}; // self.init
}; // NS:csvUploader
initalization of this module:
csvUploader.init();
So experienced colleagues what is wrong here? Modular pattern or smth else? As init() is in position 2 then method FilesAdded contents are called but up.start(); never upload file to server. Any ideas please?