title: Check an image if existing already in the folder before uploading - Codeginiter
body: <p>Do you have any sample codes or functions to check if an image name is existing already in the folder before uploading?
  I've tried using file_exists() but it doesn't work, here is my sample code:</p>
  
  <pre><code>$path = FCPATH . "images2/";
  $filename=$_FILE['userfile'];
  $full_path = $path .$filename;
  if(file_exists($filename))
  {
  ///display error message///
  }
  </code></pre>