Sleek Directory Navigator Download

Directory Navigator script allows you to display any directory on your website in an easy view format. All content is displayed in ascending alphabetical order with an option to switch from ascending to descending by clicking on the folder/file count text above the the files and folders. To display a directory’s contents just add the path to the function argument, or leave it blank to display the current directory.

You can style the CSS however you want to match your websites design. I tried my best to make it look as simple looking as possible to allow for it to be incorporated with many designs without looking out-of-place. Included in the zip is a read me file to help you get started.


  • Easy to integrate into any page.
  • Includes a breadcrumb navigation, for ease of use.
  • Displays how many files and folders are within a folder.
  • Alphabetically listed items.
  • Hide any file or folder which you don’t want the script to show.
  • Configurable file to easily add any extra file extensions too the list of 30+ already.
  • Add any custom extension icons.
  • Supports PHP4 and PHP5
  • 100% pure CSS , so it’s easily edited to your custom taste and needs.
  • HTML5 to live up to today’s web-standards.

Recent Updates

  • Removed unnecessary element ID causing HTML errors with multiple directory listings on the same page.
  • Removed jQuery requirement and replaced with plain JavaScript function. (Works on IE6 -9, Firefox 3-9, Chrome)
  • Added arrows to indicate the sort order.
  • Updated CSS class names.
  • Revamped UI with icons
  • Changed file extensions to be case-insensitive
  • Removed Terabyte, Petabyte etc. from size formatting function. I don’t think anyone will be needing those. ;)
  • Removed unnecessary loop which should speed up load times
  • Added support for international characters (eg. å, Å)
  • Fixed file counter skipping files with unknown extension
  • Cleaned up code dramatically
  • Added Google CDN jQuery file
  • Added the ability to hide files with certain extensions.
  • Improved code
  • Added more file types
  • Item icons are now part of the items link
  • Changed sorting to be case insensitive
  • Added more comments & cleaned code up
  • Removed extra slashes at the end of the folder paths
  • Added protection agaisnt extra slashes in parameter
  • Fixed an error when a directory name contained quotes.
  • Added size highlight when hovering over files.
  • Fixed unnecessary code. Should be a bit faster.
  • Removed duplicate file extension in icon list.
  • Displays an ’s’ by file/folder count only if plural.
  • Shortened URL ‘dir’ parameter to ‘d’.
  • Added spaces between slashes(/) and links in the navigation area.
  • All folders and files now sort in descending alphabetical order.
  • Added jQuery support for switching from descending and ascending alphabetical lists.
  • Changed a couple file icons and added more.
  • Home navigation link now shows as selected when viewing the home directory.
  • Links are styled blue by default.
  • Removed unnecessary lists and replaced them with divs.
  • Improved read-me file.
  • Fixed the / (slash) being part of the home link with defined directory.
  • Fixed file counter from counting hidden files. (Sorry)
  • Fixed clashing variables causing the file and folder count to be messed up.
  • Changed a big clumsy if statement to a nice neat one. :P
  • Added folder count and if there’s no folders it’ll show files and then if there’s no files it’ll display “Empty”.
  • It now highlights the current directory in the navigator.
  • Optimized the code a lot more.
  • If you have already bought this item I recommend you update it.
  • Changed the file ignore to use full paths (e.g. if ”/myFolder/index.php” is ignored, it only finds it in the “myFolder” folder not all your files).
  • Minor fixes and improvements.

Live Demo



PM me with any inquiries you may have. If there’s any errors I’ve probably forgot to add or change something, just message me and I’ll fix it! :)

  1. webdesigndeluxe:

    Make some back and forward buttons and also a download button so you can download the files. And maybe a login and logout also. Where are these files on he server? It’d be cool if it all was FTP .

  2. Jaybuz:

    You can use the Navigation bar as forward and back buttons, if you check on the live preview you’ll see. And the files are just in a normal Directory but could be made to view FTP server. Oh and I might just add that download button. :)

  3. dtbaker:

    Nice work. Was looking for something similar recently but it needed a simple “upload into current directory” option. The upload button will only display if the directory is_writable and it will prompt the user for a password before uploading.

  4. deanpcmad:

    Nice work :) If this had an upload function then Ill buy it :)

  5. stoupoun:

    Yep… Upload+Download could make this a winner!

  6. draftbeer80:

    It’s already a winner to me!!!

  7. Jaybuz:

    If you didn’t already know you can save the files by right clicking on the file, for Firefox and Chrome you just click on “Save Link As…”, IE you click “Save Target As” and for the other browsers it’s probably either of those two. So it’s easy as that.

  8. topsub:

    I think an upload function and it would be bought more

    Also how easy is the script to integrate into another cms solution?
  9. Jaybuz:

    Yeah, your probably right.

    Should be pretty easy, you can check out the read me.htm file here.

  10. c0lin:

    Absolutely awesome, easy to style. I was going to ask about authenticated access however I realized that using .htaccess would be simple enough.

  11. c0lin:

    Glad you liked it!

    If I ever get round to it I might add authentication system to it, like my simpleChat script. :)

  12. 3ga42adcy32:

    I want to buy this item, however, is it possible to have some sort of a summary footer to show the total size of the files and folder?

  13. 3ga42adcy32:

    Yeah, sure. I’ll add it tomorrow (about 8 hours). :)

  14. 3ga42adcy32:

    Great. Please confirm once you have it implemented and I’ll purchase it then. Thanks!

  15. Jaybuz:

    Sorry for being so late, but just recently I accidently formatted my Windows drive and I lost everything (a bad ubuntu command), I’ll try to get it completed by tomorrow.

  16. Jaybuz:

    Actually on second thoughts, adding folder sizes could slow the whole thing down because it would have to go through each folder right to the very end of the tree and if theres a lot of folders and files it’ll take a long time. I checked and even they do not measure folder size. Sorry but it just isn’t very practical. :(

    On another note, I did find a silly bug with clashing varibles causing folder and file count to mess up, uploading fixed version now.

  17. AzizLight:

    I bought this a while ago, but never used it before last week. It’s absolutely fantastic, great job!

    About the folder sizes, I don’t really care about this feature, but for those who are interested you could add a button to calculate the size of a given folder along with a javascript popup warning box saying that it could take some time. That would actually be useful if you want to know the size of an “images” folder without breaking your workflow.

  18. AzizLight:

    Thanks for the feedback Azizlight!

  19. maryalenn:

    I’m trying to only show the pages in the current directory (not show any directories, hide any non-php/html file types, hide file sizes) so I can create a dynamic directory navigation.

    Can this be done with this script?

  20. maryalenn:

    Hmmm, I think what you are saying is possible, although I’m a bit unsure on what exactly you want to do.

    By pages do you mean files?

  21. maryalenn:

    yes, by pages I mean webpage files (so file extensions ending in .php, or .html)

    So, for example, I have a directory/folder called “Products”, and within that I have several pages (product-a.php, product-b.php, product-c.php). I’d like to display all of the pages in the current (i.e. “products”) directory on the left hand side as a sub-navigation.

  22. Jaybuz:

    You can specify the script to display a certain directory and any folders in there you can add to the hide list. If that’s what you mean.

  23. pendyala:

    can this log no of downloads made on each file and no of visitors etc

  24. pendyala:

    No, unless you used a another script in conjunction with this.

  25. adamcartlidge:

    hey dude, firstly – awesome :)

    secondly, I’m not very good at this sort of thing – so it’s probably something stupid I’m doing wrong!

    I keep getting this error when i upload files – the error is displayed on the main page above the directory -

    Warning: filesize() [function.filesize]: stat failed for /home/a…....

    Any ideas what’s up pal?


  26. adamcartlidge:

    Hmmm, doesn’t seem to like the stat function. Is there anyway I could see it live?

  27. adamcartlidge:

    It was my fault dude, I had a mistake in my paths – sorry! Thanks for the quick reply!

    Awesome work, highly recommended -

    Those looking for the upload feature … give the guy a break, buy it first – if and when the download feature comes then you can download the update!

    Well done dude,



  28. adamcartlidge:

    Okay, thanks for the kind words. :)

    Glad you got it working.

  29. geekgurldesign:

    I love this script!!! Is it possible to organize the files by the date modified rather than alpha order?

  30. geekgurldesign:

    Oh and for some reason, I’m having a problem with the folders… for some reason it only allows people access to one other directory. How do I give everyone permission to all directories?

  31. geekgurldesign:

    I don’t quite understand what you’re saying, it should work fine with all of them. :S

  32. keithosborn:

    I’m completely new to coding but your excellent documentation made installing this a breeze. Thank you!

    I did have a quick question for you. My filenames and folders contain underscores to avoid spaces – is there any way to easily hide those in the output?

  33. Jaybuz:

    Add this under line 48 in the file core.php:

    $itemClean = str_replace('_', ' ', $item);

    And then change the variable’s $item on lines 63, 76 and 85 with $itemClean.

    Hope you get it to work! :D

  34. keithosborn:

    Worked perfectly!!! Thanks so much!

  35. pamps:

    hi, great for my new project! just one question: does it allows pagination in some way? i might have more then 200 files in a single directory so need to have a solution that can handle with that thanks

  36. pamps:

    Sorry, at the moment it does not support pagination as I wouldn’t recommend so many folders being used with this. Not that it can’t handle it but it would probably be slowed down considerably.

  37. cbowers:

    Hi, Love the script. Is there a way to hide all .css files or all files of a certain extension? I hope I didn’t miss that in the documentation. I know I saw something that said you had to specify the exact location of each file that you want to hide.



  38. cbowers:

    I’ve just uploaded an updated version of this script with your feature! It should be approved soon.

    Thanks for your purchase! :D

  39. cbowers:

    Wow! That was quick! Thanks.

  40. iAlex:

    Just got this and had it going seconds after I did.

    Perfect for what I need it for.

    Thanks a lot! :)

  41. webhuset:

    Disregard my previous message. Works great :)

  42. saftle:

    Great work on the script. With my additions it’s almost perfect. The last thing that I need to have done is the possibility to open a folder link that has a ”+” in the URL . It opens the folder without ?d=, so I know the path is correct.

    And finally, the addition of being able to see foreign characters in the filenames and folders would be great. However the links still work. The characters that I would need are ä ü ö ß.

    I appreciate the help.

  43. saftle:

    Hello again,

    Disregard the foreign characters. I used the str_replace for each character. Now just the ”+” problem left. :D

  44. JoeB:

    Great piece of code, thanks! Able to get it up and running very quickly and was just what I was looking for.

    Would be great in the future if it was a wordpress plugin where you could specify the folder to browse from in shortcode form.

    Foreign character support would be excellent, it works in the href, but not in the item description.

  45. JoeB:

    Thanks for the purchase!

    I’ve updated the code to allow international characters. I Hope this fixes your issues.

  46. PedroFelipe:

    Simple and efficient. Congratulations to the developer, excellent work! 10/10 :)

  47. PedroFelipe:

    Thank you!

  48. williamjames:

    Please add an admin demo… thanks!

  49. williamjames:

    There is no Admin demo. You use FTP to upload and edit your files.


  50. PedroFelipe:

    Does not work with files larger than 2GB, because the filesize function does not accept files larger than 2GB, see:

    I get this error: Warning: filesize() [function.filesize]: stat failed for ./FS.tar in /listDirectory/core.php on line 84

    How to fix?

  51. PedroFelipe:

    So after reading the PHP manual, I think this may work.

    Replace this in the file core.php:

    $itemSize = formatSize(filesize($dir.$item));

    with this:

    $itemSize = formatSize(sprintf('%u', filesize($dir.$item)));

    Then at the bottom replace this:

    function formatSize($size, $round = 1)

    with this:

    function formatSize(int $size, $round = 1)

    Hopefully this works. If not, I’d recommend finding a server which is running a 64 bit OS.

  52. PedroFelipe:

    Error again. This code worked for me:

    $itemSize = formatSize(exec('stat -c %s '. escapeshellarg ($dir.$item)));

    Thank you! :)

  53. tulsabobt:

    see below

  54. tulsabobt:

    Hi there, Just bought this. is there a way to edit the output, so that if an mp3 file is found, it will display an inline player as well as a download link.

    Preview button to stream and then a download link?


  55. turner2f:

    Can this also handle Video Files?

    With it being HTML 5 , can it be seen on mobile devices?

  56. turner2f:

    The files are only viewed as is. There is no embedded media but some browsers may play the video instead of showing a download dialogue.

  57. xxsashixx:

    Hey guys

    In my dirContents(), I’m using an absolute path, EG: /home/www/site

    The only problem is that function dirContents() behaves differently.. whereas the link itself will show as

    This is what I did

    I added this around after the $sort code in core.php

        $realDirArray = array('/home','/public_html');
        $realDir = str_replace($realDirArray, '', $dir);

    Just replace the items in the array() with your own values

    Then I replaced (around line 60 and 85)

    $itemURL = str_replace('%2F', '/', rawurlencode($dir.$item));

    with this

    $itemURL = str_replace('%2F', '/', rawurlencode($realDir.$urlDir.$item));

    Now I’m pretty sure there’s a much better way but that was my hacked fast version of it..


  58. ponics:

    I sent an email to your gmail address for a support question (visa.mundo). Could you check if you received it?

    Roger Pilon

  59. ponics:

    It doesn’t appear as if I got your email, sorry!

    You can find my email address in the readme file. If you didn’t already, try sending me one directly, not through ThemeForest.

  60. theglaringfacts:

    Hey Jay, just a pre-purchase question. I was wondering if this is just a simple FTP management script or a file-sharing script, except that the public cannot upload any files but that the files are provided to them for download. Is that what this script does? Provides files to the general public to download without the visitor registering and uploading their own files? Thanks a lot :) Happy Easter!

  61. theglaringfacts:

    Hello, this does not provide any FTP support. It only allows sharing/viewing of files already uploaded.

  62. bundybc:

    Hey, I’ve installed it and i’m getting these errors:

    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80
    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166
    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config\Container.php on line 111
    Notice: Undefined variable: folderIgnore in C:\xampp\htdocs\listDirectory\core.php on line 52
    Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\listDirectory\core.php on line 52
    Notice: Undefined variable: fileIgnore in C:\xampp\htdocs\listDirectory\core.php on line 53
    Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\listDirectory\core.php on line 53
    Notice: Undefined variable: fileExtIgnore in C:\xampp\htdocs\listDirectory\core.php on line 54
    Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\listDirectory\core.php on line 54
    Notice: Undefined variable: fileIgnore in C:\xampp\htdocs\listDirectory\core.php on line 62
    Notice: Undefined variable: fileExtIgnore in C:\xampp\htdocs\listDirectory\core.php on line 62
    Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\listDirectory\core.php on line 158
    Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\listDirectory\core.php on line 159
    Notice: Undefined variable: folderIgnore in C:\xampp\htdocs\listDirectory\core.php on line 63
  63. davenmick:

    Hi Jaybuz, I am having same issue as bundybc. Please can you advise what the problem is? I have also sent you an email regarding this.

    Thank you.

  64. davenmick:

    I have had no reply from this message or the email I sent over a week ago. I expect some support and a solution to my problem. You have one week before I make representations to Evento for a full refund as the script is clearly unusable in newer versions of PHP

  65. Curt92:

    Warning: filesize() [function.filesize]: stat failed for myFiles/Programs/** in /home/b1637hos/public_html/downloads/listDirectory/core.php on line 88

    Tried fixing via earlier comments, but nothing has worked. This file is 3.72GB though.