putObject($input, $bucket, $uri); // Tentatively accept that this method succeeded. $result = true; // Should I download the file and compare its contents? if (self::$downloadAfter) { // Donwload the data. Throws exception if it fails. $downloadedFile = tempnam(self::getTempFolder(), 'as3'); $s3->getObject($bucket, $uri, $downloadedFile); // Compare the file contents. $result = self::areFilesEqual($sourceFile, $downloadedFile); } // Remove the local files @unlink($sourceFile); @unlink($downloadedFile); // Should I delete the remotely stored file? if (self::$deleteRemote) { // Delete the remote file. Throws exception if it fails. $s3->deleteObject($bucket, $uri); } return $result; } }