Results 1 to 6 of 6

Thread: PHP File Browser

  1. #1
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP File Browser

    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,
    Last edited by hz1m9v; 04-20-2010 at 02:49 PM.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    What do you mean by file browser? Something to display all the files of a specific directory?
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yeap, thatīs it.

  4. #4
    Join Date
    Apr 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    And if possible the possibility of doing the files download directly from the browser.

  5. #5
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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 Code:
    <?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($file01) != ".") {
    ?>
                <a href="<?php echo $file;?>"><?php echo $file;?></a></div>
    <?php
                
    }
            }
        
    closedir($handle);
        }
    ?>
    Corrections to my coding/thoughts welcome.

  6. #6
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    is that closing div tag from another piece of code?
    Code:
    <a href="<?php echo $file;?>"><?php echo $file;?></a></div>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •