[thelist] Can't Open UNC Paths from ASP or PHP
Josh
josh at eaccessit.com
Tue Feb 4 23:20:00 CST 2003
I am using my schools webserver to access shares on other computers on
the network. The webserver is on the school network. I can't get
openDir in PHP or filesystemobject in ASP to access the shares. It is a
Red Hat linux box.
Anybody know why? Or better yet, how do I fix it?
Thanks,
Josh
Here is the code if interested:
In ASP
<%
set fs = CreateObject("Scripting.FileSystemObject")
path = "\\Atticus\Games\"
set folder = fs.GetFolder(path)
response.write(path)
ListFolderContents(path)
sub ListFolderContents(path)
dim fs, folder, file, item, url
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
'Display the target folder and info.
response.write(path)
response.write("<BR>")
for each item in folder.SubFolders
ListFolderContents(item.Path)
next
end sub
%>
In PHP
$computer = "//Atticus/Games/";
if ($dir = @opendir($computer)) {
while (($file = readdir($dir)) !== false) {
echo "$file\n";
}
closedir($dir);
}
echo "-".$dir."-";
More information about the thelist
mailing list