title: waitUntilObjectExists() Amazon S3 PHP SDK method, exactly how does it work?
body: <p>Will the function pause the php script until it finds the object on s3 servers?</p>
  
  <p>I have it inside a foreach loop, uploading images one by one. After the object is found I call a method to delete the image locally then delete the local folder if empty. Is this a proper way of going about it? Thanks</p>
  
  <pre><code>                    foreach ($fileNames as $fileName)
                      {
  
                          $imgSize = getimagesize($folderPath . $fileName);
  
                          $width = (string)$imgSize[0];
                          $height = (string)$imgSize[1];
  
                          //upload the images
                          $result = $S3-&gt;putObject(array(
                              'ACL'        =&gt; 'public-read',
                              'Bucket'     =&gt; $bucket,
                              'Key'        =&gt; $keyPrefix . $fileName,
                              'SourceFile' =&gt; $folderPath . $fileName,
                              'Metadata'   =&gt; array(
                                  'w' =&gt; $width,
                                  'h' =&gt; $height
                              )
                          ));
  
                          $S3-&gt;waitUntilObjectExists(array(
                          'Bucket' =&gt; $bucket,
                          'Key' =&gt; $keyPrefix . $fileName));
  
                          $this-&gt;deleteStoreDirectory($folderPath, $fileName);
                      }
  </code></pre>