You are here: Accessing files on the LAN « All PHP « IT news, forums, messages
Accessing files on the LAN

Posted by PeteC on 05/16/07 07:50

I have a bit of code that looks like

define("DIRECTORYPENDING","import/pending");

$d = dir(DIRECTORYPENDING);
while (false !== ($file = $d->read()))
{
// Process all files in that directory
}


Which works fine for directories within the website.

In this particular case, however, the files I need are on a shared directory
on another server on the LAN (all servers are Server2003) at
\\server2\pending (or a mapped drive, Z:, pointing to the same location)

I've tried

define("DIRECTORYPENDING",\\server2\pending);
define("DIRECTORYPENDING","Z:\pending");

but it doesn't work (yes, I do have quotes in the correct place on the
define statements above, but Outlook Express removed them!)

The error message I get is

Warning: dir(\\server2\pending\) [function.dir]: failed to open dir:
Invalid argument in E:\TestOnline\lit\admin.php on line 58

Where the line in error is the line containing $d = dir(DIRECTORYPENDING)


So... how can I read the files from the remote directory? I have control of
both servers, so can change permissions etc if required.


TIA,

Pete.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация