Hello all. I have a challenge. I have a webpage that reads all files in a directory and displays those files as a hyperlink on that page. The code is included below. It is based on a linux command that does a directory read of all files in that directory and splits it out. Then, a few lines of code create a hyperlink to those files. The purpose of it is that I allow users to drop documents into that folder, and I want the webpage to dynamically update each time they drop their document in that space.
ANYWAY....that works fine. Now, I have a new twist to this. I need to read files from a WindowsNT directory and display those files as a link. My code is specific to Linux.
Anyone have any ideas on how to accomplish this?? Does NT have a similiar command to the 'ls' command in Linux??
Here is my working Linux code. Some code has been removed for posting purposes.
$httppath ="http://files.mysite.com/" . $filelocation;
$templistpath="/var/wwwfiles/" . $filelocation;
$templist = ls -1 $templistpath | grep -iE "$filetypes";
$files = split("\n", $templist);
for ($i = 0; $i < count($files); $i++)
{
$totalcount = count($files);
echo "\n";
if ($totalcount == 1){echo 'No files currently available';}
print '<a href="' . $httppath . $files[$i] . '">' . $files[$i] . '</a>';
}