Question

First of all, i must appreciate that plupload is a great plugin. i have used in one of my screens with pluploadQueue(). Now i am trying to use the same plugin in a different screen with custom UI. This screen has a single link to uploaded and want to upload as and when the file is added. With the below code, it is not triggering FilesAdded event.

var uploader = new plupload.Uploader({
  // General settings
  runtimes : 'html5',
  browse_button : 'uploadImage',
  multipart: true,
  multi_selection: false,
  file_data_name: 'uploadFile',
  multipart_params: {uploadName: 'value'},
  url : 'server-url-here',
  // Specify what files to browse for
  filters : {
    max_file_size : '5242880b',
    mime_types: [
      {title : "Image files", extensions : "jpg,gif,png"}
    ]
  },
  init: {
    FilesAdded: function(up, files) {
      alert('File added 1');
    }
  }
});
uploader.init();

I also tried binding FilesAdded outside of init. but no luck

uploader.init();
uploader.bind('FilesAdded', function(up, files) {
  alert('File Added 2');
});    

Not sure what I am missing.

JFYI: The file I am trying to upload is a jpg image with less than 1MB size.

Was it helpful?

Solution

This issue exists with the plupload version that I was using i.e. plupload-2.0.0. Taken plupload-master and it works well now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top