25th Oct 2006

PHP Ajax File Browser 2.0 Beta

Update: Version 2.0.1 is available. Update post found here.

After the success of the PHP Ajax File Browser V1.1, I’ve re-invented the wheel with this new version. It’s not just a simple file browser anymore!Public Front endHere’s a list of features (some were already present in 1.1):

  • Easy to use interface
  • Allows public or restricted users to download anything you allow
  • Share directories do not have to be beneath the site root
  • Permissions: List, Download, Upload and Delete
  • Administration Area for easy maintenance
  • Simple self installation script
  • Display extra links
  • Logs everything to a Mysql database
  • Reports on downloads, clickthrus, everything.
  • Theme Support
  • Block certain filetypes, filenames and directories
  • Small page weight

Note: This is a beta. It will have bugs. Use at your own risk. I use it, so it can’t be that bad ;) But I do take no responsibility for loss of data etc etc. Also, I hope that you’re wise enough not to share the site directory of this application, or people could download your config files and get your passwords.

Administration AreaInstallation

Just unzip to a directory somewhere on your webserver, and point to index.php. Installation will ask you for details from there. The application does not need to be at the root of your site (anymore).

So, where do you get it?

Please report bugs and suggestions here. See below for a list of compatibilities.

Op System Webserver PHP Mysql Result
Windows Apache 2 5.1.4 5.0.22 OK
Linux Apache 2 4.4.3 4.1.21 OK
Op System Browser Result
Windows Firefox 1.5 OK
Windows Firefox 2 OK
Windows IE 6 OK
Windows IE 7 OK

If you have had success or failure with other combinations please let me know - particularly non Windows browsers.

Known issues

Contributor Problem
Rutger Files and directories with accented characters such as ‘é’ and other like ‘ø’ cause the application to hang when retrieving a directory listing. Resolved in 2.0.1

Technorati: ajax, php, javascript, web 2.0

35 Responses to “PHP Ajax File Browser 2.0 Beta”

  1. Jason Says:

    Hey, nice work. Just had a quick play with this now but it looks very nice. One quick suggestion tho… After you have uploaded it just displayes the upload screen again. Perhaps “Home” link somewhere obvious might be helpful? (I know you can click Cancel and get back there, but that just doesn’t feel right)

  2. Hristo Says:

    Great scripts. thanks for the update.

  3. Rutger Says:

    nice script, but directories with lots of files or subdirectories won’t show up in IE7. works fine in Firefox though.

  4. Rutger Says:

    same problem with IE6. the large directory has 153 subdirs in it. small dirs (with 10 subentries) are working perfectly.

  5. Minime Says:

    this looks interesting - gonna try it out. thx, bro

  6. Minime Says:

    works great, BUT there is ONE MAIN FEATURE MISSING and thats upload functions.

    upload function shold be possible to enable/disable pr user pr directory (or to the same directories that the user have access to, with the same rights)

    if a company wants to use this script as filestorage/fileshare, they cant have only 1 user supplying the files using FTP - they should all be able to upload files to share.

    you shold also consider a “send” function, where the receiever getz a message where to get the file (www.site.com/112233.zip where the file location is hidden for the receiever).

    the proggie is great as it, but but these ajusments (or the first anyways) i could sell this script to several of my customers, looking for safe and secure online storage and fileshareing.

    :-)

    thx

  7. jc Says:

    Minime,

    There is upload functionality in this application (as stated in the 4th point of the feature list).

    For an example of the Uploads, goto http://ajaxfb.jc21.com and observe the Upload share. On the right there is a green button with an arrow up. That is the upload button. Additionaly, for this site, public users don’t have permission to view the uploaded files. At this stage, all permissions can only be applied on a per Share basis, not different for every directory beneath a share.

    I’ve chosen this approach so that you can add / remove files and directories on your server without having to change permissions on various directories or files every time you change the contents of a Share directory.

    If you want allow uploads for a Share, in the Shares section of the Admin, click the blue Key icon next to the share. You only need to have the Upload permission ticked for the account to allow uploads without viewing the files.

    If the account has list and upload permissions, then the account can upload files to any directory beneath the Share. But of course, they can also overwrite files this way.

    If I’ve misunderstood your meaning here, let me know.

    You suggestion about email notifications has crossed my mind, and will probably come into fruition.

  8. jc Says:

    Rutger,

    It’s nice to see that MS has made IE7 a ‘critical’ update now. Much sarcasm intended there! Both versions of IE have the same javascript trouble though - which I can only assume is the problem.

    I have tested the large directory listings (50+) in both IE6 and 7, on XP and Vista. There was no faults, here are some shots:

    Long directories in IE6:
    http://blog.jc21.com/wp-content/screenshots/ajaxfb2/t1.jpg
    Long file list in IE6:
    http://blog.jc21.com/wp-content/screenshots/ajaxfb2/t2.jpg
    Long directories in IE7:
    http://blog.jc21.com/wp-content/screenshots/ajaxfb2/t3.jpg
    Long file list in IE7:
    http://blog.jc21.com/wp-content/screenshots/ajaxfb2/t4.jpg

    Can you tell me, where there any Javscript errors with the page? Are there any weird characters in your files or directories? (non ascii or another language, even ‘ and ” could be at fault - I admit I haven’t tested that)

  9. Gascan Says:

    It’s work perfectly.. my personal opinion: its great!

    but i have one suggestion: what if for registered users and this have all privileges on a particular folder has a “create new folder” as a subfolder with the same primary folder permission aswell?

    it would be nice right?

    greetings!

  10. jc Says:

    You may have confused me. So you want to be able to Create directories?

    Sure sounds good. Currently you can’t delete directories… even though in the admin somewhere it says you can… The trivials of beta software!

  11. Rutger Says:

    Internet Explorer doesn’t report any Javascript errors.
    Apart from normal letters, digits and spaces, the following special chars are used: -’,.&[]()øé

    I found out, the problems are the é and the ø chars. In PHP, I would use the htmlentities function, but since this is JavaScript and I know nearly nothing about JavaScript, I don’t know how to solve this problem.

    Thanks for your help.

  12. Victor Says:

    Hi, I installed this, but it seems like the .css isn’t working or something. I’m using Firefox 2, and I also tried it in IE 6. Am I missing something?

    Here’s where i installed it.
    http://www.vrdt.net/afb%5F2%2D0beta/

    guest as the username and password.

    Thanks…

  13. ismet Says:

    Hi jamie,

    This is a great product!! Thank you!

    I have three questions:
    1. Is there a way to increase the 7MB limit for the file uploads?
    2. How can we enable file uploading to anonymous users too?
    3. As I saw, there are no language files. Is there an easy way to translate ASB into another language(Are phrases kept in the same file)?

  14. jc Says:

    Victor,

    The css file on your site is working fine. Did you install it to one directory and then move it? At a guess, the config file is not correct (includes/config.inc.php).

    On line 8 there is a BASEURL global definition. I’m guessing it defined as ‘/’ at the moment, when it should be ‘/afb%5F2%2D0beta/’ for your site.

    The Base URL specifies where to find the CSS and Javascript. It is relative to the Domain name (www.vrdt.net) and when the application is placed in a sub directory it should be specified in the config file.

    Alternatively, you could delete config.inc.php and install again, it will not delete any existing tables or entries in the database if they already exist.

  15. jc Says:

    Ismet,

    Thanks for your feedback. Here are some answers:

    1. Yes. To increase the upload limit for your site, depending on your hosting, you need to edit php.ini, add a php.ini to the application root, add or edit a .htaccess file in your application root. If you’re hosting yourself, just edit the php.ini. Look for ‘post_max_size’ and ‘upload_max_filesize’. They can be set to the same. The lesser value of the two is used as the maximum for the upload.

    2. The enable uploading for anonymous users: When viewing the Shares tab in the Admin, click on the Key icon to the right. The the third column of checkboxes for the accounts you want uploads to apply. In this case, anonymous account. Here’s a screenshot:
    http://blog.jc21.com/wp-content/screenshots/ajaxfb2/ulperms.jpg

    3. Sorry, no language files at this stage. Probably should look into it though.

  16. Victor Says:

    Hey jc,

    I reinstalled it 3 times without moving it, all in different directories, but got the same results as before. I’m not sure why the install script didn’t create my config file with the right settings of the BASEURL, but changing the created config file fixed this.

    What I think would be really cool is if you could incorporate ajax to see a thumbnail version of images, or listen to an mp3 on clicking. I guess previewing it within the browser before downloading.

    Anyway, I think it’s an awesome app! Good work… I’ll be looking forward for any updates.

    Thanks…

  17. Alex Says:

    Is it possible to create “FOLDERS / DIRECTORIES” from inside the application, instead of creating them manually?

  18. jc Says:

    Victor, the application determines the baseurl from the document root and http host variables. Maybe they are reporting incorrect values. But at least you’ve solved the problem!

    Alex, currently it’s not possible. It’s main function is a file browser at this stage. Perhaps in later versions.

  19. benjamin Says:

    Looks like it would fit my needs, but i get some include php error when i try to download the package (afb_2-0beta.zip) from your website :( any change it’ll be fixed ? thanks

  20. jc Says:

    Whoops, my bad. It’s fixed now.

  21. Björn Says:

    Maybe i don’t understand the idea of the filebrowser. But there’s a fact which is confusing me.
    If i create an extra useraccount with the rights to list and to download (no admin rights) for an special share and i login with this user i can change the settings of the administrator and create new shares as well?
    But the user should only be able to login and download in my view, nothing else?

  22. jc Says:

    Bjorn, thanks for pointing this out. This is a major bug, and although the extra user is not an admin, if they login and view admin.php, or login via admin.php then they are granted access.

    I will get on top of this asap and update the version.

  23. phil Says:

    file link doesn’t work still:

    Invalid Request

    afb_2-0-1.zip

    Array
    (
    [0] => files
    [1] => afb_2-0-1.zip
    )

    files/afb_2-0-1.zip

  24. digerati Says:

    Invalid Request

    afb_2-0-1.zip

    Array
    (
    [0] => files
    [1] => afb_2-0-1.zip
    )

    files/afb_2-0-1.zip

    Thats what I get when I try to download the file.

    Also the text on this page to enter in the blanks to send this message is WHITE, thats crazy hard to see.

  25. jc Says:

    It’s murphy’s law. Works now

  26. Warrior Says:

    can someone tell me how to make it so that the imgs wont show up indcating if its a zip file and also how to make the font blue and how to remove the size of the files from showing up

  27. jc Says:

    It’s not something easily possible with the app, as I don’t see why anyone would want to do that.

  28. Mike Says:

    First of all, it looks like a wonderful app. Well, I know this isn’t some troubleshooting forum but I don’t know where else to ask. I’m getting an internal server error and I know it’s due to the .htaccess file. Here’s a link to my servers answer for when this happens:
    http://help.godaddy.com/article.php?article_id=1655&topic_id=&&
    I’ve done what they said and made sure the permissions were correct as well as transfered the file in ASCII mode but still an error. Does anyone have an answer for me?

  29. jc Says:

    Hi Mike, I’ve covered this problem in the comments of the latest AFB post. You can jump straight to the solution here: http://blog.jc21.com/2006-11-13/php-ajax-file-browser-201/#comment-96

  30. Mike Says:

    Thank you for the quick reply that’s excellent.

  31. irfan Says:

    Hi This is a great product, but I think if you could add the forgot password feature that would be great

  32. blog.jc21 » Blog Archive » PHP Ajax File Browser Says:

    […] New Version: Ajax File Browser 2.0 Beta, this version is no longer supported. […]

  33. Doodee Says:

    Thanks for sharing

  34. dj)q Says:

    Hi This is a great but when a try to download files is say error 404.
    Can you help mu to download please.

  35. jc Says:

    Version 2 of this is no longer available. However version 3 is available from http://sourceforge.net/project/showfiles.php?group_id=193937

Leave a Reply