protected function cleanFile($path, $fileName) { $file = substr($path, -1, 1) != "/" ? $path . '/' : $path; $file .= $fileName; $actual = file_exists($file); if ($actual) { unlink($file); } }