Jump to content

Basic PHP File Browser with download capability


rapier_gv

Recommended Posts

first of all, hello everybody, as you can see i'm new here so you gotta be extra nice to me!  ;D

 

i'm not quite the php guru but i need the following thing for my next project: as the title says, i want to build my very own php file browser, which does a very basic listing of a predefined folder. below is my code this far:

 

if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            echo "$file<br />\n";
         
      }
    }
    closedir($handle);
}

 

what i want and don't know how to do is showing a nice little checkbox before every listed file and a download button to.. well, obviously download the chosen files.

 

i know this is kind of a noobish question, thanks in advance for any help or suggestions whatsoever!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.