title: Is a subfolder in an S3 bucket an object?
body: <p>I'm trying to get the size of a subfolder in S3 using PHP (Codeigniter). If I specify a file in the folder, the data is returned, however if I specify the folder I get:</p>
  
  <pre><code>[NoSuchKey] The specified key does not exist.
  </code></pre>
  
  <p>Which I believe means it can't find the file/folder. Is a folder not an object you can get the size of?</p>
  
  <p>I've used S3 browser for Windows and that lists the folders and their sizes.</p>
  
  <p>Here's a snippet of the code I'm using:</p>
  
  <pre><code>$userdir = 'userdata/'.$row-&gt;name;
  $userdata = $this-&gt;s3-&gt;getObject('bucket_name',$userdir,false);
  
  foreach ($userdata as $name =&gt; $val) {
      $totalSize += $val['size'];
  }
  
  $totalSize = ($totalSize / 1024 / 1024 / 1024);
  </code></pre>
  
  <p>Any ideas appreciated!</p>
  
  <p>Thanks!</p>