How to make a file_exist from a server to the local machine ?

Posted by bahamut100 on Stack Overflow See other posts from Stack Overflow or by bahamut100
Published on 2010-06-18T08:47:49Z Indexed on 2010/06/18 8:53 UTC
Read the original article Hit count: 265

Filed under:

Hi, how to test if a file exist on the current computer using the application ?

I try to put the full url at my file like this, but it doesn't work :

if(file_exists("C:/wamp/www/project/photo/".$nom_photo))
        {
            echo "file exist";
            $extension=pathinfo("C:/wamp/www/project/photo/".$nom_photo,PATHINFO_EXTENSION);
            echo "<br>";
            $nom=md5($nom_photo.time().rand(0, 99999)).".".$extension;
            echo $nom;
            rename("C:/wamp/www/project/photo/".$nom_photo,"C:/wamp/www/project/photo/".$nom);
            echo "<br>";


        }

How to fix it ?

© Stack Overflow or respective owner

Related posts about php