Jump to content

How do I list the files in a folder on a mapped or network drive?


rtsanderson

Recommended Posts

I am using the following script to list all of the files in a folder. The script is running on our server but I need the listing of data on a drive connected to another computer on the network. It works fine on the local drive on the server but it does not work when I try to access a mapped drive or another computer. Can this be done with the script I'm using?

 

<?php
$dirname = "c:";
$dir = opendir($dirname);
while(false != ($file = readdir($dir)))
{
if(($file != ".") and ($file != ".."))
{
echo("$file <br />");
}
}
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.