public function getFileSource() { if (!$this->id) { return null; } $cacheFile = $this->_getCacheFile(); if (!file_exists($cacheFile)) { $s3 = new Kwf_Util_Aws_S3(); $r = $s3->get_object(Kwf_Config::getValue('aws.uploadsBucket'), $this->id, array('fileDownload' => $cacheFile)); if (!$r->isOk()) { $body = file_get_contents($cacheFile); unlink($cacheFile); throw new Kwf_Exception($body); } } return $cacheFile; }