Log in

View Full Version : PHP File Browser



hz1m9v
04-20-2010, 02:26 PM
Good Afternon to all,

Anybody can help me to find a good PHP File Browser to me to share some documents?

Best Regards for you help in advance,

bluewalrus
04-20-2010, 02:57 PM
What do you mean by file browser? Something to display all the files of a specific directory?

hz1m9v
04-20-2010, 03:15 PM
Yeap, thatīs it.

hz1m9v
04-20-2010, 03:17 PM
And if possible the possibility of doing the files download directly from the browser.

bluewalrus
04-20-2010, 03:38 PM
Something like this, this is trimmed down might of deleted something by mistake but I think this should do it...

Can also check here for more info:
http://php.net/manual/en/function.readdir.php


<?php
$path = "/images/";
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
//Check that the file name doesn't start with a "." because .s are hidden files
//if there is another name to check for add it in with && $file != "" or (if ((substr($file, 0, 1) != ".") && ($file != "NAME") {
if ((substr($file, 0, 1) != ".") {
?>
<a href="<?php echo $file;?>"><?php echo $file;?></a></div>
<?php
}
}
closedir($handle);
}
?>

ggalan
04-22-2010, 02:00 PM
is that closing div tag from another piece of code?


<a href="<?php echo $file;?>"><?php echo $file;?></a></div>