title: BlueImp Plugin jQuery File Upload : How to use the fileInput option so that fileupload() can bind new dynamically added inputs?
body: <p>I use the BlueImp plugin to upload my files. A new file input is added dynamicaly by the user when he clicks on "Add a file".<br/> Then, when the user uploads a file it is stored via AJAX in my web folder.<br/></p>
  
  <p>My first idea was to call the fileupload method on the id generated (for example : <code>$('#files_0').fileupload( { //ajax processing } );</code><br/>
  But this solution is not working as the input does not exist when the page is loaded. <br/><br/>So I need something like <code>$('#files_0').live('click, function ({ fileupload( { //ajax processing } ) )};</code> but that's not working also.<br/><br/>
  So I check the documentation and forums and found that were a solution using the <code>fileInput</code> option. So here what I've done, but that's not working..Any help would be great !</p>
  
  <pre><code>$('#myDiv').
      fileupload(
      {
          fileInput : $('#files_0),
          dataType: 'json',
          url:'{{ path('MyBundle_ajax_upload_picture') }}',
           progressall: function (e, data) 
           {
              var progress = parseInt(data.loaded / data.total * 100, 10);
              $('#progress .bar').css(
                  'width',
                  progress + '%'
              );
            },
           add: function (e, data) 
           {
              $(this).fileupload('process', data).done(function () {
              data.submit();
              });
            },
           done: function (e, data) 
           {
              $.each(data.result.files, function (index, file) {
              $('&lt;p/&gt;').text(file.name).appendTo(document.body);
              });
           },
          always: function (e, data) 
          {
             console.log(data);
          }
      });
  </code></pre>