Image upload

Hi,

I am trying to upload an image to my server.
Everything worked fine when working locally but when uploaded to my server, file_exists($target_path) returns true even when I can see that there is no such file at the requested path.

$target_path = SITE_ROOT.DS.'photo_gallery'.DS.'public'.DS.$this->upload_dir.DS.$this->filename;
    //Make sure the file doesn't already exist in the target location
    if(file_exists($target_path)){
        $this->errors[] = "The file {$this->filename} already exists.";
        return false;
    }

SITE_ROOT is set:
defined(‘SITE_ROOT’) ? null : define(‘SITE_ROOT’, $_SERVER[‘DOCUMENT_ROOT’]);

I have echo’d out $target_path successfully so know that the path is being set.
Would it have anything to do with the absolute path vs relative path?

Stuck???

I logged into the file manager and can see the file, hence it returns true.
However I can’t see the file through FTP access???

Any ideas why? It’s just a simple jpeg