Regarding the comment by 'admin at crazydrumguy dot info': You might want to consider using is_file instead of file_exists if you're wanting to target a file specifically (and not a directory). file_exists($name) will return true if $name contains a path to a directory (which may or may not be what you want to do...)
umask