Jump to content

File manager


justsomeguy
 Share

Recommended Posts

I've been using this thing forever. When I was in college I built a little script to act as a simple file manager online so I could upload to my web space through HTTP from anywhere, and also to give me an online bookmark collection. It can hold links as well. I figured I'd make it available to anyone who wants it, it's dead simple to set up and use. No database necessary. The zip file is here:http://www.manchine.net/steve/files/filemgr.zipInside the file are index.php and users.php, plus some images and CSS and the folders for links and files. To install, open index.php and change the path you see at the top to the location where you install it on the server. Then open users.php and you'll see this:

<?php$accounts = array();$user['mword'] = 'password_here';$user['access']= 'full';$accounts['password_here'] = $user;$user['mword'] = 'readonly';$user['access']= 'readonly';$accounts['readonly'] = $user;?>

I did this in a hurry, so the structure is sort of stupid. The mword value ("password_here") contains the password to log in, and the $accounts array also needs the password as the key. So if you change the password, change it in both the mword and $accounts lines:

$user['mword'] = 'password_here';  //here$user['access']= 'full';$accounts['password_here'] = $user;  //and over there

"full" access is exactly that, and "readonly" is.. well, also exactly that. readonly is no deleting, adding files, editing links, etc. There is also a "limited" access type where you can limit the account to files in a specific directory.Once you change the index.php and user.php, just go to the index page in your browser, type in the password, and go nuts. This is one of the first things I did in PHP (dig that inline HTML!), so if anyone has questions go ahead and ask. And if anyone wants to make any changes, feel free to post an updated version with a description of what you changed.

Link to comment
Share on other sites

When I attempt to make a directory I receive this errorWarning: mkdir() [function.mkdir]: No such file or directory in E:\Program Files\XAMPP\xampp\htdocs\filemanager\index.php on line 185It also treats function.mkdir as a link to a file it believes should exist http://localhost/filemanager/function.mkdir

Link to comment
Share on other sites

Hmm.. did you set the options on top of index.php?

<?php$page_title = "File Browser";$menu_title = "Files and Links";$basepath = "e:\\inetpub\\wwwroot\\filemgr\\"; // set this to the folder where the script is installed$relative_file_path = "files"; //the relative file path to the folder to store files$linkdir = "links/";$uploaddir = "files/";
In that case, the script is installed in e:\inetpub\wwwroot\filemgr\, and files are saved in e:\inetpub\wwwroot\filemgr\files\. Make sure the $basepath is set to the folder where you put the script (apparently E:\Program Files\XAMPP\xampp\htdocs\filemanager\), and you can probably leave the $relative_file_path like it is, unless you changed the name of the "files" folder. So use this:
$basepath = "E:\\Program Files\\XAMPP\\xampp\\htdocs\\filemanager\\";

If that doesn't work, use this:

$basepath = "E:\\Progra~1\\XAMPP\\xampp\\htdocs\\filemanager\\";

Link to comment
Share on other sites

Worked perfectly. Thanks. I had it set as a relative path to the index file so I didn't even consider that. This is definitely very well made. Good job.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...