rtsanderson Posted February 23, 2010 Share Posted February 23, 2010 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 />"); } } ?> Link to comment https://forums.phpfreaks.com/topic/193082-how-do-i-list-the-files-in-a-folder-on-a-mapped-or-network-drive/ Share on other sites More sharing options...
developerdave Posted February 23, 2010 Share Posted February 23, 2010 For security reasons I don't think PHP is able to read the contents of another machines folders (imagine an internet like that, wow!) lol Link to comment https://forums.phpfreaks.com/topic/193082-how-do-i-list-the-files-in-a-folder-on-a-mapped-or-network-drive/#findComment-1016822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.