title: How to use jQuery file upload?
body: <p>I am trying to use the <a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">blueimp jQuery File Upload plugin</a>, but without much success. I want my script to upload the file along with other form details when my user clicks the Save button. So far I have this:</p>
  
  <pre><code>$(document).ready(function() {
      $('#custom-file-upload').fileupload({
          dataType: 'json',
          autoUpload: false,
          url: get_current_url() + '/customFileUpload/',
          done: function (e, data) {
              //$.each(data.result, function (index, file) {
              //  $('&lt;p/&gt;').text(file.name).appendTo(document.body);
              //});
          },
           change: function (e, data) {
              $.each(data.files, function (index, file) {
                  $("#custom-file-upload-filename").text( file.name );
              });
          },
          submit: function(e, data) {
              console.log('submit event fired');
              return false;
          }
      });
  
      $('.edit-form .btn-submit').click(function(ev) {
          ev.preventDefault();
      })
  });
  </code></pre>
  
  <p>So when my user clicks the "Attach File" button, a nice file browser pops up, they pick a file and click Open, and it shows the filename next to the Attach File button. </p>
  
  <p>I do not know how to get it to submit my form now though. I've tried a bunch of different things and after reading the docs I still have no idea.</p>