Click to See Complete Forum and Search --> : opendir() connecting to one area on server but not another


CWCJimmy
02-23-2006, 03:10 PM
I'm trying to access multiple folders throughout several areas on several PCs to move images around. I'm having one problem area though and I'm not sure why this is happening.

Here's what I have:


$small_path = "images/myimages/";
$med_path = "\\\\server3/images/jpeglibrary/";
$local_path = "\\\\server3/images/";
$local_path2 = "\\\\server3/folder1/folder2/images/jpeg/";

//WORKS
$small = opendir($small_path) ? "Connected <br>" : "Did not connect!<br>";
//WORKS
$med = opendir($med_path) ? "Connected<br>" : "Did not connect!<br>";
//WORKS
$local1 = opendir($local_path) ? "Connected <br>" : "Did not connect!<br>";
//DOES NOT WORK
$local2 = opendir($local_path2) ? "Connected<br>" : "Did not connect!<br>";

echo $small . $med . $local1 . $local2;

//WORKS
echo "<img src=\"{$local_path2}1200 1256553.jpg\">";



$local_path2 is my problem child. It gives me this error

Warning: opendir(\\server3/folder1/folder2/images/jpeg/) [function.opendir]: failed to open dir: Invalid argument

I've checked permissions on all the folders in the path of $local2 and there are no restrictions. I know that the path is good because it the <img> link works. I just don't know what else to think.

I'm not sure if this matters or not but some accounting software is installed on server3 and $local_path2 is within it's directories.

Any ideas? :confused:

bokeh
02-23-2006, 04:03 PM
\\server3/folder1/folder2/images/jpeg/ Run that from the dos prompt and see if you can access the directory.

CWCJimmy
02-23-2006, 04:59 PM
Yessir, it sure does

NogDog
02-23-2006, 05:22 PM
Just to see if you can get PHP to tell you anthing more:

//DOES NOT WORK
$errorLevel = ini_get('error_reporting'); // DEBUG
error_reporting(E_ALL); // DEBUG
$local2 = opendir($local_path2) ? "Connected<br>" : "Did not connect!<br>";
error_reporting($errorLevel); // DEBUG

CWCJimmy
02-23-2006, 05:29 PM
No luck with that. Nothing displayed.

I'm assuming all I have to do is pop that code where $local2 was.