I want to find out whether a file is existing or not
The file is stored on another machine in the same network .
I tried the following code.But always showing "The file is not existing".

<?php $filename = 'file://';

if (file_exists($filename))
   echo "The file $filename exists";
} else
   echo "The file $filename does not exist";

Does anyone know how to do this?

Hi divyakrishnan,

for me it seems as if you're using Windows. Simply try


. As I'm mainly using Unix, I don't know exactly how the address-structure looks like in a Windows-Domain. But as long as you mask you slashes correctly, it should work perfectly when you use the address given by the explorer.

Keep in mind that this does only work, when the server let's you out of the sandbox. In real-server-mode you do get trouble. You can then install an other webserver and access the data via


. For me that's a much cleaner solution.

Hope that helps, Simon.

I am using windows.Tried

$filename ='\\\\\\\\\\E:\\PDF\\p.pdf';

still not working.

the path for windows looks like
where Folder is the name of the folder that is shared

commented: simply true +6

Hi divyakrishnan,

you CANNOT access the complete filesystem of a remote computer! If that were possible, it'd cause a mess in security policies!

fikreyes is completely right. Have a look at basic Windows networking before trying to programme such things.

Greetings, Simon