Is it possible to open files over the network using php fopen function? I am using php 4.2.
Assuming you have file sharing enabled over TCP/IP, I would say definantly yes, however, it may also be possible under other network conditions as well.
What OS / Network are you running?
WIN2K server for web and trying to access a file in the WINNT server. I use the following code. $fName = "\\servername\sharedirname\filename"; if( file_exists ($fName)) { echo "File exists.<br>"; } else { echo "File not exists.<br>"; exit; }
and it can't see the file at all. I've set full access permissions for Inet user account.
Try changing this: $fName = "\\servername\sharedirname\filename";
To this: $fName = "\servername\sharedirname\filename";
It doesn't help. I guess my additional "\" is to preventing the escape character.
I think the problem is due to the permissions. My file is at the share point directory and this directory has got full control permission for everyone. I was thinking the guest account of internet user will be able to see the file with this security settings. Seems like it is not. Any suggestions?
Try to add the permision to the directory for the right user, and try to browse it from your web PC.
I think it is the permission cause usualy win2k server need a authorize/logged user to the pc before use the share directory.
Brgds, Mulianto
Hello Mulianto,
Can you give me some suggestions on how to set the account for this situation? I guess all the browsers connect using the account IUSR_servername. I'm able to map my destination server drive in my web server uing this account. But through the web page, I am still not able to open this file. Any suggestions? Thanks for your efforts.