I would use here `is_file()` or `file_exists()` PHP functions