title: How to format a URL to get a file from Amazon S3?
body: <p>I am having some trouble figuring out how to access a file from Amazon S3. Lets say that the bucket that the file lives in is <code>BUCKET_NAME</code>, the file is <code>FILE_NAME</code>, etc. I have tried the following two URLs:</p>
  
  <pre><code>https://s3.amazonaws.com/BUCKET_NAME/FILE_NAME/
  ?Expires=EXPIRATION
  &amp;Signature=SIGNATURE
  &amp;SignatureVersion=2
  &amp;SignatureMethod=HmacSHA1
  &amp;AWSAccessKeyId=KEYID
  </code></pre>
  
  <p>But this gives me the following error: </p>
  
  <pre><code>&lt;Code&gt;NoSuchKey&lt;/Code&gt;
  &lt;Message&gt;The specified key does not exist.&lt;/Message&gt;
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>https://s3.amazonaws.com/BUCKET_NAME/
  ?Key=FILE_NAME
  &amp;Expires=EXPIRATION
  &amp;Signature=SIGNATURE
  &amp;SignatureVersion=2
  &amp;SignatureMethod=HmacSHA1
  &amp;AWSAccessKeyId=KEYID
  </code></pre>
  
  <p>but this returns a webpage with a list of all of the files in the given bucket (including <code>FILE_NAME</code>), instead of the specific file I want. I have also tried throwing in <code>Action=GetObject</code> into the URL as well but that doesn't seem to change anything. </p>
  
  <p>It would be helpful to find out which (if any) is the proper method and what I am doing wrong. I have been digging through Amazon's documentation for a while now but I can't seem to sort it out.</p>