title: S3 Force File Download with NodeJS
body: <p>I am trying to force files to download from Amazon S3 using the GET request parameter <code>response-content-disposition</code>. </p>
  
  <p>I first created a signed URL which works fine when I want to view the file.</p>
  
  <p>I then attempt to redirect there with the <code>response-content-disposition</code> header. Here is my code:</p>
  
  <pre><code>res.writeHead(302, {
    'response-content-disposition': 'attachment',
    'Location': 'http://s3-eu-west-1.amazonaws.com/mybucket/test/myfile.txt?Expires=1501018110&amp;AWSAccessKeyId=XXXXXX&amp;Signature=XXXXX',
  });
  </code></pre>
  
  <p>However, this just redirects to the file and does not download it.</p>
  
  <p>Also when I try and visit with the file with the <code>response-content-disposition</code> as  GET variable:</p>
  
  <pre><code>http://s3-eu-west-1.amazonaws.com/mybucket/test/myfile.txt?Expires=1501018110&amp;AWSAccessKeyId=XXXXXX&amp;Signature=XXXXX&amp;response-content-disposition=attachment
  </code></pre>
  
  <p>..I reveive the following response:</p>
  
  <p><code>The request signature we calculated does not match the signature you provided. Check your key and signing method.</code></p>