title: HTML5 FormData file upload with RubyOnRails
body: <p>I using this script to upload file (one by one) with HTML5 FormData in Rails 3.2.8 application.</p>
  
  <p><a href="http://jsfiddle.net/RamPr/" rel="noreferrer">http://jsfiddle.net/RamPr/</a></p>
  
  <pre><code>$('.uploader input:file').on('change', function() {
    $this = $(this);
  
    $('.alert').remove();
  
    $.each($this[0].files, function(key, file) {
      $('.files').append('&lt;li&gt;' + file.name + '&lt;/li&gt;');
  
      data = new FormData();
      data.append(file.name, file);
  
      $.ajax({
        url: $('.uploader').attr('action'),
        contentType: 'multipart/form-data',
        type: 'POST',
        dataType: 'json',
        data: data,
        processData: false
      });
    });
  });
  </code></pre>
  
  <p>But when I upload a file, I get this error in console:</p>
  
  <pre><code>webrick/server.rb:191:in `block in start_thread' ERROR ArgumentError: invalid %-encoding ("filename.jpeg" Content-Type: image/jpeg
  </code></pre>
  
  <p>How can I solve this error?</p>