Error opening network link

Asked

Viewed 72 times

1

Good Afternoon,
I am using the code below 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 above code is used to list directories. It is working perfectly. However, when I click on the link, it shows a 404 error.

The requested URL /terms/ SR9 Controls Terms MYFILE.pdf was not found on this server.

How to solve?

  • 1

    access files through the URL: you have to have the right bar that I know about. Because there is no way to access the network through the browser. And it has to have a sort of address: http://localhost/arquivos/seuarquivo.pdf but if you are listing directories by browser, try this: \\\SR9/Infraestrutura/Controles/Termos/A/seu_arquivo.pdf

  • This is from a server.

2 answers

0

By network you won’t be able to, but I believe that if you do this, it might work, if you’re listing directories through the browser from a server:

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

0


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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.