Page 1 of 1

syntax of path to file_exists

Posted: Fri Aug 20, 2004 4:21 am
by t_ravichandu
Hi all,

i'm usin the following code to determine whether a file exists or not. While i can see that the file really exists at the given path..the result in the browser is "not exists". giving the code..

Code: Select all

<?php 

if( file_exists('/html/ravi/sing.JPEG') ){ 
echo "exists"; 
} 
else echo "not exists"; 
?>

i think the problem is in the way i give the path, i mean the syntax.
pls correct me.
chandu

Posted: Fri Aug 20, 2004 6:36 am
by markl999
The syntax looks fine, it has to be down to the path which should be an absolute path rather than a relative one.
From a command prompt 'ls -la /html/ravi/sing.JPEG' should work fine if the path is correct, does it?