s3rvant
01-08-2010, 03:25 PM
I'm trying to open a network drive, but am getting the error "failed to open dir: No error"
Here is my code:
// Parameters to map network drive
$drive = "Z";
$path = "\\server\share";
$user = "domain\user";
$pass = "pass";
// Map the drive
system("net use ".$drive.": \"".$path."\" ".$pass." /user:".$user." /persistent:no>nul 2>&1");
// Open folder
$dir = opendir("Z:\\") or die('Unable to open '.$path.);
I can run the opendir with C: and open a local folder without any issues, but attempting to access the Z: gives the error. I figure it's an authentication issue, so I've gone to the server and made sure that the "domain/user" I'm using has full permissions for that share, but I still get the error.
Do I need to add more permissions elsewhere or is this a different issue?
I also ran the net use command in a windows cmd prompt to make sure there were no bugs there, it ran fine. Both computers are running XP Pro and I'm coding on Xampp 1.7.2.
Any help would be much appreciated.
Here is my code:
// Parameters to map network drive
$drive = "Z";
$path = "\\server\share";
$user = "domain\user";
$pass = "pass";
// Map the drive
system("net use ".$drive.": \"".$path."\" ".$pass." /user:".$user." /persistent:no>nul 2>&1");
// Open folder
$dir = opendir("Z:\\") or die('Unable to open '.$path.);
I can run the opendir with C: and open a local folder without any issues, but attempting to access the Z: gives the error. I figure it's an authentication issue, so I've gone to the server and made sure that the "domain/user" I'm using has full permissions for that share, but I still get the error.
Do I need to add more permissions elsewhere or is this a different issue?
I also ran the net use command in a windows cmd prompt to make sure there were no bugs there, it ran fine. Both computers are running XP Pro and I'm coding on Xampp 1.7.2.
Any help would be much appreciated.