Error opening network link

1

Good afternoon,
I'm using the following code to open a folder over the network:

$dir = "\\SR9\Infraestrutura\Controles\Termos\A\" ;

$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>";
        }
}

The code above serves to list the directories. It's working perfectly. However, when I click the link, it displays a 404 error.

  

The requested URL /termos/\SR9\Controles\Termos\A\MEUARQUIVO.pdf was   not found on this server.

How to solve?

    
asked by anonymous 01.10.2015 / 21:56

2 answers

0

Solved by removing a slash at the beginning, which caused the system not to find the file.

$dir = "\SR9\Infraestrutura\Controles\Termos\A\" ;
    
28.12.2016 / 14:11
0

By network you will not be able to, but I believe that if you do this, it might work, if you are listing directories through the browser from a server:

$dir = "\\SR9/Infraestrutura/Controles/Termos/A/" ;
    
01.10.2015 / 22:11