public function removeFileFromApplicationBucket($filename, $prefix)
 {
     ProjectConfiguration::registerAws();
     $s3 = new AmazonS3();
     $bucket = ProjectConfiguration::getApplicationAmazonBucketName();
     if ($s3->if_bucket_exists($bucket)) {
         $response = $s3->delete_object($bucket, $prefix . '/' . $filename);
         if (!$response->isOK()) {
             throw new Exception("Error deleting file!");
         }
     } else {
         throw new Exception("Amazon bucket '{$bucket}' does not exist!");
     }
     return $response;
 }