title: Split file with JavaScript or jQuery
body: <p>I need to upload a part of a file (only the first MB). I've created a PHP script which uploads the whole file. The data (<code>formData</code> Object) is passed by a ajax call. </p>
  
  <p>My idea would be now to split the file with javascript (jquery). Is there any solution for my request?</p>
  
  <p>Current code:</p>
  
  <pre><code>function start(a){
      //var fSize = $('#fileUpload')[0].files[0].size / 1024;
      var formData = new FormData();    
      formData.append( 'fileUpload', $('#fileUpload')[0].files[0] );
      //AJAX
      $.ajax({
          url: 'script.php',
          type: 'POST',
          data: formData,
          processData: false,
          contentType: false,
          success: function(msg){
              alert("Win: " + msg);
          },
          error: function(bla, msg){
              alert("Fail: " + msg);
          }
      });
  }
  </code></pre>