title: How To: CodeIgniter - jQuery-File-Upload: multiple file upload in a single request
body: <p>I am really stuck on this problem.</p>
  
  <p>I got the blueimp jquery file uploader running on codeigniter, now I have problems to get multiple files uploaded in a single request.</p>
  
  <p>The problem I face is that each uploaded file fires the uploadhandler.php where I want to do some database inserts. Each file uploaded fires a database insert, but I need the uploadhandler to be fired just for each submit no mather how many files there are in one submit.</p>
  
  <p>-EDIT-</p>
  
  <p>This the jQuery part:</p>
  
  <pre><code>$('#fileupload').fileupload({
      url: 'upload/do_upload',
      singleFileUploads: false,
      acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
      maxFileSize: 5000000 //5 MB
      add: function (e, data) {
          if (data.autoUpload || (data.autoUpload !== false &amp;&amp; $(this).fileupload('option', 'autoUpload'))) {
              data.process().done(function () {
                  data.submit();
              });
          }
      }
  });
  </code></pre>