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 />"); } } ?> Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.