public function copy() { /* @var $new S3File */ $new = parent::copy(); ob_start(); //copy our new one to its own path. $newPath = parent::getNiceDir($new->get('path')); $this->client->copyObject(array('Bucket' => AMAZON_S3_BUCKET_NAME, 'Key' => $newPath, 'CopySource' => $this->get('bucket') . "/" . $this->get('path'), 'ACL' => 'public-read')); $new->set('path', $newPath); $new->set('bucket', AMAZON_S3_BUCKET_NAME); $new->save(); ob_end_clean(); return $new; }