List directory over the network

3

I'm using the code below to read files:
Locally it works, but when I put the $ dir variable with a network path, as below, I get error:

$dir = "W:/_Infraestrutura/Controles/Inventario de Equipamentos/ " ;   
$pasta= opendir($dir);    
echo "<ul data-role='listview' data-inset='false' data-filter='true'>";   
echo("<li data-role='list-divider'><a href='#'>A</a></li>"); 

while ($arquivo = readdir($pasta)){
    if ($arquivo != '.' && $arquivo != '..'){
        echo "<li><a href='".$dir.$arquivo."' rel='external' >".$arquivo."</a></li>";
        }
}
  

Warning: opendir (W: / _ Infrastructure / Controls / Inventory   Equipment /, W: / _ Infrastructure / Controls / Inventory of   / /: In C: \ wamp \ www \ terms \ index.php on line 26

     

Warning: opendir (W: / _ Infrastructure / Controls / Inventory   Equipment /): failed to open dir: No such file or directory in   C: \ wamp \ www \ terms

     

Warning: readdir () expects parameter 1 to be resource, boolean given   in C: \ wamp \ www \ terms \ index.php on line 31 \ index.php on line 26

    
asked by anonymous 25.09.2015 / 20:57

1 answer

-1

You need to specify the protocol, use opendir("ftp://...") or ftp_connect

This question is answered here:

link

    
27.09.2015 / 03:05