1
I am using the code below to try to read the files in a directory.
$dir = "\\\\192.168.44.19\Controles\Inventario de Equipamentos\A\ " ;
$pasta= opendir($dir);
echo("<li data-role='list-divider'><a href='#'>B</a></li>");
while ($arquivo = readdir($pasta)){
if ($arquivo != '.' && $arquivo != '..'){
echo "<li><a href='".$dir.$arquivo."' rel='external' >".$arquivo."</a></li>";
}
}
But I get the message from error:
Access denied. (code: 5) in C: wamp www terms index.php on line 30
Manually, by My Computer or by accessing the Linux Terminal address
192.168.44.19\Controles\Inventario de Equipamentos\A\
you can easily access?– Giancarlo Abel Giulian
you need to change the folder permission for reading, if you are using linux do
sudo chmod -R 777 "nome da pasta"
– RFL
@Rafaelacioly chmod 777 is a bit dangerous. it just needs reading access.
– MoshMage
@Giancarlogiulian, yes. Access normally.
– Lucas Torres
@Rafaelacioly, my user has Total Control in the folder
– Lucas Torres
@Moshmage, it’s just for internal use. I don’t know if I’d have much trouble
– Lucas Torres
Make a
is_dir($dir)
, checks if the return istrue
.– Diego Souza
@Deesouza false
– Lucas Torres
It means it doesn’t exist. Make sure that this is the way ?
– Diego Souza
@Deesouza, check the path. Really was incorrect. I corrected, but still the error remains.
– Lucas Torres
These four bars at the beginning are normal ? I’ve never seen this. It would be nice if you renamed the folders and left them without spaces.
– Diego Souza
@Deesouza with or without the 4 bars, same error. The folders unfortunately have no way to rename ...
– Lucas Torres
Try to access the machine name instead of your IP.
– Diego Souza