title: Checking if a object exists on amazon s3 using AWS api
body: <p>I am working on the AWS api and having an issue with the check for existing objects(FOLDERS).<br/>
  I went through <a href="https://stackoverflow.com/questions/15814058/amazon-s3-if-object-exists-method-issue">this</a> question and it does not help me because I am using the latest updated SDK.<br/>I searched the SDK and found <a href="http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.S3.S3Client.html#_doesObjectExist" rel="nofollow noreferrer">this</a> which should work i.e. <code>doesObjectExist</code>,but I am not able to find the function definition anywhere.My <code>s3.php</code> file doesn't have this function.<a href="https://github.com/tpyo/amazon-s3-php-class/blob/master/S3.php" rel="nofollow noreferrer">Here</a> is my S3.php class.<br/>
  Also I read that S3 does not support folder structures but just visually makes it look like its stored in a folder due to the <strong>flat file system</strong>. Now,if I have to search a folder <code>1024x768</code> on S3,do I have just check the root of the bucket? I mean like this</p>
  
  <pre><code>     $chkFileExist = $s3-&gt;doesObjectExist($bucketName,'1024x768');
  </code></pre>
  
  <p>I need to check if the folder exists and if not create it on the fly dynamically using the API functions.If it exists store the files over there.<br/>I need help in achieving this functionality.Please can anyone suggest solution with their experience.<br/>Thank you for your attention.</p>