Search code examples
jquerytwitter-bootstrapfile-uploadjquery-file-uploadblueimp

Blueimp File Upload 'done' and 'progressall' callback not getting called. Can someone help me to fix this


I am using Blueimp Jquery File Upload plugin to upload files sequentially. I am trying to call 'progressall' and 'done' callbacks so as to display global progress bar in bootstrap modal pop-up. I want to close back the modal pop-up once file uploading is done.

The issue which I am facing is that I am not able to trigger the callbacks. I included debuggers in the plugin code to see I am missing out something or what but those debuggers never got hit.

Below is the jQuery snippet which I am trying to use. I am able to trigger addFileToTable method which adds file details to a table, but the 'fileuploadprogressall' is not getting triggered no matter if I write the option or bind it.

    $('#file_upload').fileupload({
         limitMultiFileUploads: 1,
         sequentialUploads: true,
         autoUpload: false,
         dropZone: $('.dropzone4'),
    }).bind('fileuploadadd', addFileToTable).bind('fileuploadprogressall', function (e, data) {debugger;});

I have add the javascripts in the following order:

  1. js/vendor/jquery.ui.widget.js
  2. js/jquery.iframe-transport.js
  3. js/jquery.fileupload.js
  4. js/jquery.fileupload-ui.js

I'm not sure how I should go about fixing/ debugging this issue.

Thanks


Solution

  • // in your main.js 
    //this for done
    $('#fileupload').bind('fileuploaddone', function (e, data) {}); 
    //this for profressall
    $('#fileupload').bind('fileuploadprogressall', function (e, data) {});