PHP
  Home arrow PHP arrow Page 3 - Setting Up a Web-Based File Manager: bfExplorer
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Setting Up a Web-Based File Manager: bfExplorer
By: Barzan "Tony" Antal
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 6
    2008-04-15


    Table of Contents:
  • Setting Up a Web-Based File Manager: bfExplorer
  • Installing bfExplorer
  • Configuring and Using bfExplorer
  • Taking a Break

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Setting Up a Web-Based File Manager: bfExplorer - Configuring and Using bfExplorer
    ( Page 3 of 4 )

    Each time you log in, the file manager opens the "root" path of that current user. First, you need to delete or change the "admin" default user and set your own settings. We do this at the Control Panel. You can see it is the last icon on the upper toolbar. You click on it and then select "User Administration."

    Starting from that panel, you can add "New User" as well as edit the settings of existing user accounts. When you create a new user, you need to specify its username, password, group (Administrators, Users, Guests, etc.), Name (anything), E-mail (anything), and Home Directory. The home directory starts from the "/public_html" in the case of paid hosts on shared servers, so you shouldn't include that one already!

    If you're going to have multiple/varied types of users, then I'd suggest modifying the existing user groups. Who knows? You may need a group called "Guests," "Power Users," or "Limited Users," along with the "Administrators." You can enter into the Group Administration menu from the Control Panel. Also, this is the place where you set the permissions. Remember, we didn't specify the kinds of access levels for the users we've created. We have done this by "enrolling" them in specific groups.

    Now let's see bfExplorer in action, while viewing/editing source code. Notice the way its syntax is highlighted thanks to GeSHi. The attached screen shot is resized to 400 pixels on its width to preserve the aesthetic aspects of this page. For higher quality screen shots of bfExplorer, visit the screen shot section of the official website (here).

    Let's attach another screen shot. You need to see how it handles images too. Keep in mind that it also supports the "search" feature, which is especially handy when your web space is cluttered and disorganized. In a nutshell, bfExplorer does everything you should ever need from a file manager. If you can get it online and working, then you won't ever struggle to access your files all over the world.

    Last, but definitely not least, bfExplorer supports uploading files to your server. This is also done with its PHP-based HTML POST engine. Here, I'll give you a tip on how you should use this feature without compromising the security of your server. First, to have write access to a folder, it needs to have full permissions (777). You shouldn't have this all the time, since it can easily turn into a security hole.

    Here's what I'd recommend: Leave the security permissions (file attributes) on the rest of your folders intact, meaning don't "chmod 777" all of them. This way, the rest of your folder cannot be compromised. Then create a new directory, something along the lines of /upload or /files or /data. Who knows what you need? This is going to be the folder you will eventually "chmod 777" (rwxrwxrwx).

    Now you should be able to upload files, create folders, and have full control over that folder you've just created via bfExplorer (once you are logged into your profile!). On the rest of your folders, you should just have read access. You can "organize" your files later on when you're at home in a "safe" environment with the help of a stand-alone FTP client application. Right now, what's important is the ability to host something as soon as possible without fiddling with FTP clients and whatnot.

    If you have created the /files folder on your hostname.com website, then users could access your files if they type "hostname.com/files" into their browsers. You may or may not like that this is possible. Here's what to do. Create a new text file in that folder and call it ".htaccess" (pay attention to that little dot at the beginning). Add the following to its content:

    Options -Indexes

    The above line prohibits Apache from listing the contents of the directory to the public. As a result, your visitors (including you) will receive a 403 error message when they visit "hostname.com/files" via an Internet browser. But when you log in to your trusty bfExplorer, you will have full access. The same applies to an FTP client.

    If you want to allow certain guests to upload scripts into that folder, then be cautious, because 777 also gives "execution" permissions. This can also be compromised. I'd also add the following three lines in your .htaccess file. Keep in mind that each folder should contain a .htaccess file with its very own directives.

    RewriteEngine on

    RewriteCond %{REQUEST_URI} .php [NC]

    RewriteRule .* / [L,R]

    The above code snippet disables the "automatic" execution of PHP scripts in that folder. This is useful when somebody uploads a PHP shell script that ends up exploiting the security of the server and giving unauthorized access. However, none of the previous techniques are one-hundred percent secure, so use it just for educational purposes. You shouldn't rely on these when storing millionaire innovations.



     
     
    >>> More PHP Articles          >>> More By Barzan "Tony" Antal
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek