title: Upload files to Amazon S3 With Dropzone.js issue
body: <p>I'm trying to upload files to S3 service using <a href="http://www.dropzonejs.com/" rel="noreferrer">Dropzone.js</a></p>
  
  <p>I use this tutorial to upload the files directly from the client:</p>
  
  <p><a href="https://devcenter.heroku.com/articles/s3-upload-node" rel="noreferrer">https://devcenter.heroku.com/articles/s3-upload-node</a> - this tutorial doesn't include the implementation with dropzone js (which was a nightmare)</p>
  
  <p>The flow is pretty simple:</p>
  
  <ol>
  <li>Ask from my server to get signature from amazon</li>
  <li>get the signed request url + the expected file url from amazon</li>
  <li>override dropzone.options.url with the signed request url</li>
  <li>call dropzone.processFile to upload the file to the server</li>
  </ol>
  
  <p>The file is uploaded to the server, until here everything is ok, when I'm trying to view the file (in S3 Bucket interface) it seems like the file was not write correctly and i can't view it.</p>
  
  <p>According to the source code the file is upload using FormData object.</p>
  
  <pre><code>Dropzone.prototype.submitRequest = function(xhr, formData, files) {
    return xhr.send(formData);
  }
  </code></pre>
  
  <p>if i change the source code from:</p>
  
  <pre><code>xhr.send(formData)
  </code></pre>
  
  <p>to</p>
  
  <pre><code>xhr.send(files[0])
  </code></pre>
  
  <p>Everything works great but i lose to ability to upload multiple files.</p>
  
  <p>This is the dropzone config:</p>
  
  <pre><code>{
     url: 'http://signature_url',
     accept: _dropzoneAcceptCallback,
     method: 'put',
     headers: {
        'x-amz-acl': 'public-read',
        'Accept': '*/*',
        'Content-Type': file.type
     },
     clickable: ['.choose-files'],
     autoProcessQueue: false
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VCzFv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VCzFv.png" alt="Request HTTP Headers"></a></p>
  
  <p>Hope it's enough :)</p>
  
  <p>Thanks.</p>