20 OCT

PHP Directory Listing Script

Back in 2008 we created the original version of our popular directory listing script. Since then we’ve released three new versions, addressing a number of known issues. In 2015 we completely rebuilt the script from scratch, introducing some handy new features and improvements.

The PHP Directory Listing Script is a highly configurable script, allowing you to simply upload one file into a web-accessible directory, and it’ll be turned into a well formatted, mobile friendly directory browser.

With the release of version 4, we’ve got some great new features, including:

  • Full mobile browser support.
  • The ability to upload multiple files and restrict the allowed file-types.
  • Support for restricting access to the script by either password or IP Address whitelisting (ideal if you want only yourself and clients to have access!).
  • Support for creating new directories and sub-directories.
  • Upload zip files and extract them automatically, with the option to delete the zip file after it’s been extracted.
  • Optionally hide certain file types, names or extensions, as well as directories.
  • Sort file listings by name, size or last modified date.

Finally, the last feature is that the Directory Listing Script now runs as a single file, weighing in at less than 400kb. This means the script runs faster, and is extremely easy to use!

All of the new features can be enabled and disabled individually, so whether you’re looking for a full file manager, or a simple list of downloads, the PHP Directory Listing script has you covered.

System Requirements

To run the PHP Directory Listing Script on your website, you’ll need to be running PHP 5.3 or above and have the GD2 library installed. If you wish to enable the unzip support, you’ll also need the ZipArchive php extension installed.

Download

To download the script please click here. The ZIP file contains all you need to run the script. To setup the script please see the top of index.php.

Installation

To install the PHP Directory Listing Script, simply extract the zip file and open up the index.php file. Inside you’ll see a number of options that you can alter. Once you’ve set your options, simply upload the file into your directory and then browse to it from the web. You should now be up and running!

Future

We’re always open to feedback for improvements and suggestions so please leave any ideas in the comments section below and we’ll do our best to incorporate them into a future update.

Tags: , ,

Written by Ash Young

Ash is the founder of Evoluted and is passionate about helping clients succeed in a digital environment. In his spare time he likes long walks in the country and lie-ins at the weekend. He does not like losing lunchtime games of Fifa. You can follow Ash on Twitter or Google+ Read more posts by Ash Young

Free social media icons for every subscriber

Sign up to our mailing list to have new updates delivered straight to your inbox. Every subscriber will get a free pack of social media icons!


254 Comments

  1. Patrick

    February 17, 2011 at 11:50 am

    First: Thanks for sharing this great Script. It save a lot of work. :)

    But i have some Bugs, when i did implemented the script in my site. Only if i set the path to “.” i can go to the subdirectories. If i set it to a subdir, than i can see the content, but then i cant go down in other subdir’s. And if I want to download the files via forcedownload, i get a lot of various characters, but no download popup. :( The demo works fine..but i dont know why it doesnt work anymore when i implemented it via include. I hope you can help me.

    • team

      Ash

      February 17, 2011 at 12:26 pm

      Thanks for the comment Patrick, we’ll take a look at the bugs and get a new version posted ASAP.

      • Patrick

        February 17, 2011 at 12:45 pm

        Okay, thanks. Maybe the include solution is the reason why i cant set the standard subdirectory…i dont know. The demo works fine. :(

      • lolo

        February 25, 2011 at 4:28 pm

        Thanks much! Very usefull script!
        I’ll be happy to get that correction concerning the subdirectories problem

      • Matt

        April 13, 2011 at 6:58 pm

        Hey, thanks for the nice script. I could definitely use the solution to the sub directories problem as well. Cheers…

    • team

      James Thomas

      April 14, 2011 at 2:40 pm

      Hi Patrick,
      For people wishing to include the file in their script, we have added an $includeurl; variable for you to add the actual URL of the script in your site; take a read the comments in the new zip file! As for the the download problem you were having, try again with the new script.

      • Matt Cram

        April 16, 2011 at 12:04 am

        Thanks to Ash, James, and team for the V3 update…

    • Dmitry Garanin

      May 17, 2011 at 6:41 pm

      I know this directory lister for a couple of years and now I planned its more extensive use at http://lokshin.org/Scores/ .

      Unfortunately, the output is broken, although filenames are OK.

      Also there is no simple customization. Changing the style file is difficult, especially that my web server has a big latency and does not immediately show results of my experiments. I remember with some version of changed style file the output was not broken but the sizes were distorted.

      If it remains like this, I will have to delete the style file and have a raw output, that will also do the job.

      A comparable free file lister that I have found is bobbsfilelist. It works but is not customizable and uses while text on a black background that I don’t like.

    • Aldo

      June 29, 2012 at 9:48 am

      Love the available features. And spanks everything else I’ve found that’s free.

      For some reason though I can’t get it to work on files larger than about 4Mb…even on files that I’ve confirmed work. PHP.ini is set to 40Mb so that’s not it.

      It shows loading progress to 100%, then waits for the website, refreshes, and nothing happens. No error messages and no new file in the directory. Just looks like nothing happened. Ideas?

  2. Tomas

    February 18, 2011 at 10:59 pm

    This is really a GREAT WORK!!! You saved my *ss! Thanks a lot! Everything works fine, even that “subdir browsing” Patrick talked about. Thanks again!

  3. CaliVW78

    February 20, 2011 at 4:19 pm

    First off, where do I donate? This was extremely useful, and much appreciated.

    Secondly, is there any example of how I could paginate this? Some directories have tens of thousands of files, which can be an issue for those with older machines with less horse power.

    Thanks again!

    • team

      Ash

      March 04, 2011 at 8:12 am

      Thanks for the comment, no donation is required!

      We’re looking at pagination for a future release.

  4. Mister Smith

    February 25, 2011 at 8:10 am

    Looks really great, but doesnt fit for me because this script isnt able to handle large filenames…

    if it could, it would be my absolute favorite dirlister

    • team

      Ash Young

      March 04, 2011 at 8:16 am

      Do you have an example of where you’ve tried to use the script with longer filenames?

      • peter

        March 07, 2011 at 11:21 am

        When the filename is to long to fit into one line, weird things happen. E.g. the icons of the files show up in the middle of the previous row.

        Another bug: the script cant handle UTF8-filenames yet. The links work, but the non-american characters in the names are shown wrong.

        Regards,
        Peter.

    • Don McKenzie

      July 10, 2011 at 9:50 pm

      Does everything I need, as I have set mine up as a public deposit and viewer for a special interest user group,

      I have got the contributors to include the following:

      YYYY-MM-DD-firstname-lastname-filename-Version.zip

      So that the file explains itself, however if you expanded the width to cater for about another 16 characters, it would be perfect.

      I tried, but there is too many setting for me to tackle. Found the filename shorten-er, and adjusted that a little.

      Thanks in advance,

      Cheers Don…

  5. Edgar

    February 27, 2011 at 3:22 pm

    SEO friendly urls would be very nice. Right now the output looks very scary.

    • tygrysalex

      March 24, 2011 at 8:30 am

      SEO friendly urls + pagination = THE BEST Directory Listing Script

      Please, do it for humanity 😉

  6. yinka

    March 05, 2011 at 7:39 pm

    This is the best free PHP directory script so far.

  7. akhtar

    March 07, 2011 at 9:51 am

    Hi,
    is there any way i can see the preview without going inside the director.

    i would like to preview the images from outside the image with the mouse right click.

    thanks

  8. satwik

    March 09, 2011 at 5:33 am

    Hi

    I am already using your script for directory listing which is great. I have got more than 200 files now and is it possible to add any search function on the page? Has it been in effect yet? I will appriciate your reply.

    • Artax

      May 18, 2011 at 2:39 pm

      Simply hit Ctrl+F and you’ll get a nifty search box. 😉

  9. Eric

    March 10, 2011 at 7:43 am

    I’m LOVING the script. However, I need to figure something out.
    I have multiple directories I want to list files from, but I can’t figure out how to code it.
    Basically, I have the script in its root folder. Underneath that I have separate users who each have a mod folder.
    I need the script to display the mod folders of EACH user.
    For example: it’s currently showing /0figment0/mods (The true path is mcmodders/0figment0/mods)
    But I also need it to display the contents of /ikeelyou/mods and later on more users as well.
    How would I code that?

    • Eric

      March 11, 2011 at 5:24 am

      No ideas?

  10. Ukyo

    March 10, 2011 at 6:03 pm

    Nice script!

    I second the “pagination” motion, it’d be nice for directories with a big number of files.

  11. Adam

    March 11, 2011 at 2:19 pm

    This works just great!
    Thanks for sharing :-)

  12. JT

    March 11, 2011 at 4:17 pm

    Would love to have an option in the config area to disable the “Last Modified” and only show file name and size. (My site uses many long file names) In addition, having a version that is more mobile phone friendly (for Android preferably) would be great.
    Thanks for the fantastic script!

  13. Scott

    March 15, 2011 at 10:45 am

    Hello, I was wondering if there was an alternate .css file for the directory listing script that would make the table wider, especially where the file name shows up. Also, seems like with wide screen browsers might be better to make it wider in general Basically I’ve got some long file names and they are getting cut off.

    Also, is there a way to make the file names not be the bold font in the listing?

    Super script over all, just trying to figure out how to best tweak it to fit my needs. Thanks!

  14. armin

    March 19, 2011 at 11:05 pm

    Woow, Very Nice script. That was very useful. Thanks

  15. php4pro

    March 21, 2011 at 3:46 pm

    there is a problem if i put folder path instead of ‘.’ it’s working but the sub folder contents not appear?

    Thank you

    • team

      James Thomas

      April 14, 2011 at 2:10 pm

      Hi there,
      This issue has been addressed; setting a path in $startdir should no longer prevent files from displaying.

  16. Dinaker

    March 22, 2011 at 5:25 am

    Hello,

    I have downloaded and installed the code and it’s working fine. But the index.php file has an upload form and I don’t see any upload option to upload files to the directory on my website. Please help.

    • Dan T

      April 14, 2011 at 6:51 pm

      To enable uploads, just activate the one variable:
      $allowuploads = true;

      (file size is up to 8 megs)

  17. Linda

    March 22, 2011 at 3:51 pm

    I really like your script. Is there a way to get it to expand to show the files listed in the directory without having to click on the directory?

    Also can I use this script for a commercial application?

  18. Dan Eliot

    March 23, 2011 at 5:23 pm

    LOVE this script. The only issue we’ve had is that really LARGE FILES for download don’t seem to work well with the script. To be fair, however, that may be PHP and our provider, and not the script. Anybody use this script on DREAMHOST with large (100meg+) files?

  19. Dan Eliot

    March 23, 2011 at 5:24 pm

    Also… is this V2 or V3? The ZIP says V3, but the comments in the script say V2??

    • team

      James Thomas

      April 14, 2011 at 2:12 pm

      Hello Dan,
      The comments in the code have been updated accordingly.

  20. Ratio

    March 25, 2011 at 3:55 pm

    Hey,

    is there a way to integrate a search button to search for files.
    And, i only want to display rar files.
    Also a way?

    regards

  21. Mads

    April 02, 2011 at 2:22 pm

    Hey ThinkTank

    In my directory listen, the preview of big images does not show.

    How can i make my big images have the preview funktion?

    Ect, tjek this site:
    http://madsschou.com/Brian%20Gjerstrup/

    • team

      James Thomas

      April 14, 2011 at 2:15 pm

      Hi Mads,
      This issue was due to the fact that your PHP setup did not assign enough memory for larger files to be converted. We have therefore added a $memorylimit variable to the configuration section, so you can assign more memory if you need it!

  22. schiho

    April 04, 2011 at 1:42 am

    Hi, i would like to know if you can run this script locally when setting the www path under php.ini to C:\outputs\

    thanks!

  23. Cris

    April 05, 2011 at 12:08 am

    Sorry for my English. I’m using Google translator.
    Excellent script!!!
    Ash, It can be used for ftp?
    What should change?

    Thanks

  24. Italic Remover

    April 05, 2011 at 8:00 pm

    Can the italic be removed from file sizes? I can’t seem to find the code for it in the files.

    • Cizzz

      October 27, 2011 at 1:01 pm

      Add font-style:normal in CSS #listing a em

  25. sacha

    April 05, 2011 at 9:23 pm

    This script is really good.

    I’ve a bug, files larger than 2go appears in the list but with size at 0kb, and impossible to download.

    How to fix it ????

    Thanks in advance !

  26. arifwicaksono

    April 07, 2011 at 2:58 am

    very nice script, but i found it strange because i see upload code in it, but i see nothing about upload file.

    how do i upload a file ?

    • team

      James Thomas

      April 27, 2011 at 2:22 pm

      Hi there,
      To upload files, set the “$allowuploads” flag to “true”. This will place a file upload form on to the page which will upload files to the current directory.

  27. Rob

    April 07, 2011 at 10:41 am

    Hi. Nice work on this.

    I seem to behaving with the upload functionality, I’ve set it to true but nothing seems to get uploaded to the site, any other problems had with this?
    Thanks

    • team

      James Thomas

      April 27, 2011 at 2:37 pm

      Hi Rob,
      Be sure to check the permissions on the folder you’re trying to upload to. If the folder is not write-enabled then the files will not be uploaded.

  28. Christian

    April 11, 2011 at 11:19 am

    HI,

    Great Script
    i ran it on an Windows IIS.
    Everything works fine, but Upload is not possible.
    Other upload scripts work proper. I don´t found the issue.
    Can someone give me an hint to find it out?
    Regards Christian

  29. Jai Gopal Kumar

    April 11, 2011 at 4:34 pm

    I want to make online directory. But there are few problems. First I don’t know which software or which version should I install on my computer because there are lots of php scripts. That is making confusion for me.

  30. Pierre

    April 14, 2011 at 7:56 am

    Hi. AMAZING script! Thanks a million. Is there a way of sorting the files by Most Recent date though? I did look at the “asc” and “desc”, but after switching between those, nothing happened still.. please help. thanks.

    • Cbr

      April 15, 2011 at 4:54 pm

      Works like a charm ! Thank you :)
      Have also tried to work it out. Anyone solved this or has any idea ?

  31. Pierre

    April 14, 2011 at 8:03 am

    Ooh and is there a way of specifying only certain filenames to be displayed in one directory, although there’s a few?

    Eg. directory DOC/ has 10 files starting with CHA??.pdf and 4 starting with DAN??.pdf. Can I put ^DAN..\.pdf$ down somewhere to only display the 4 DAN files?

  32. Mike

    April 15, 2011 at 12:30 am

    This is a great script! It saved me hours of doing this directory listing by hand!

  33. Eric

    April 16, 2011 at 11:20 am

    I never did see an answer to my question regarding this script. I’ll re-post here. I’m hoping someone else is wondering this too

    I’m LOVING the script. However, I need to figure something out.
    I have multiple directories I want to list files from, but I can’t figure out how to code it.
    Basically, I have the script in its root folder. Underneath that I have separate users who each have a mod folder.
    I need the script to display the mod folders of EACH user.
    For example: it’s currently showing /0figment0/mods (The true path is mcmodders/0figment0/mods)
    But I also need it to display the contents of /ikeelyou/mods and later on more users as well.
    How would I code that?

  34. Ratio

    April 22, 2011 at 7:52 am

    I only wnat to Display .rar or .zip files.

    A way through this???

    • team

      James Thomas

      April 27, 2011 at 12:28 pm

      Hello Ratio,
      We’ve added a new array called “$showtypes” which will only allow speficied file types to be displayed.

  35. Dedeniz

    April 25, 2011 at 10:41 am

    Great work, thanks so much 😉

  36. b0y

    April 27, 2011 at 8:59 am

    hi bro… thanks for your’e script….
    it’s realy great code… 😀
    i want ask. how if i’m set $allowuploads = false; became “true”. so all people can upload all type off file on server.

    and i want ask. how if i want limit file type for upload.
    like as i just want user can upload type .jpg only. 😀
    thanks brother

    • team

      James Thomas

      April 27, 2011 at 12:26 pm

      Hi there,
      Yes, setting the $allowuploads flag to “true” will allow the user to upload files in to the directory they’re currently viewing, so long as that directory can have files written to it.

      We’ve set up a new array, “$uploadtypes” which specifies what types of file the user can upload.

      • b0y

        April 27, 2011 at 2:30 pm

        hi bro thanks for your attention 😀
        where i can place new array “$uploadtypes” cos in dirlistingv3 i can’t see this array function and command to call 😀
        thanks for your’e attention my bro 😀

        • team

          James Thomas

          April 27, 2011 at 3:08 pm

          Hi again,
          Take a look at line 113 in the updated index.php – this is the array you’ll need. It’s currently commented out. Uncomment the array and enter the filename extensions you need; a few should already be in there as an example to get you started!

          • b0y

            April 27, 2011 at 11:02 pm

            hi bro… 😀 i can’t see you’re command in lin 113. sorry my it’s my eye wrong or i’m really can’t see that.
            this my screenshot index.php
            dumbcrooks.com/dirlis.JPG
            correct me if i wrong.
            and i’m download last script in you’re site
            http://www.evoluted.net/thinktank/wp-content/uploads/2011/02/dirlistingv3.zip

            thanks my bro 😀

          • team

            James Thomas

            April 28, 2011 at 8:29 am

            Hello again!
            From the looks of your screenshot you’re getting an older version of the script so please try downloading again. If you still get the version without the $uploadtypes array, clear your browser cache and try again.

          • b0y

            April 28, 2011 at 9:49 am

            hello again my bro 😀
            yes if i’m download old version so where i’m can get new version for this script??
            because in this page post, im just see this link download
            http://www.evoluted.net/thinktank/wp-content/uploads/2011/02/dirlistingv3.zip

            so where i can get new version for this script 😀
            thanks my bro 😀

          • team

            Ash Young

            April 28, 2011 at 5:09 pm

            The link above has been updated with a new ZIP file containing the updated PHP.

          • b0y

            May 02, 2011 at 4:29 am

            hi bro 😀 thanks bro…it’s now really new version for listing script. 😀
            thanks bro :DD

  37. b0y

    April 27, 2011 at 2:51 pm

    hi bro thanks for your attention
    where i can place new array “$uploadtypes” cos in dirlistingv3 i can’t see this array function and command to call
    thanks for your’e attention my bro

  38. Eric

    April 27, 2011 at 8:15 pm

    Still now answer to my question?
    I’d like the script to show the files in multiple directories while still giving people access to only their directories.
    So basically, ModA goes to website.com/Moda/upload and uploads their files. ModB goes to Website.com/MobB/upload and uploads his files.
    Users go to website.com/modfiles and see a listing of what’s in Moda and modb’s upload folder.

    • team

      James Thomas

      April 28, 2011 at 8:26 am

      Hi Eric,
      Unfortunately this is not a feature we’re planning to add at this time.

    • Dungeon

      August 27, 2011 at 10:04 pm

      What you require involves some Alias settings in Apache or using symbolic links to make directories appear under a different structure.

      It *is* possible to do in this script, but that will involve creating an authentication system (or interfacing it to one) which is outside the scope of this script.

      There are many content management systems with plugins that do what you require. This is simply a directory/file display script.

  39. b0y

    April 28, 2011 at 4:53 pm

    hello again my bro
    if i’m download old version so where i’m can get new version for this script??
    because in this page post, im just see this link download
    http://www.evoluted.net/thinktank/wp-content/uploads/2011/02/dirlistingv3.zip
    but James Thomas says this old version.
    so where i can get new version for this script with $uploadtypes array.
    thanks my bro

  40. Thankful!

    May 22, 2011 at 2:38 am

    This is exactly what I needed.

    I have a question though, do you have any advice on how I would go about having the images display as a gallery?

    Say, lightbox integration, for example?

  41. Dmitry Garanin

    May 22, 2011 at 1:50 pm

    The listing is broken on my site http://www.lokshin.org/Scores/

  42. Daedalus

    May 31, 2011 at 1:58 pm

    The script really rocks -have been using it for years. A feature I’m missing is the ability to create folders. That would rock! Keep up the great work! Thanks!

    • Daniel

      November 11, 2011 at 3:55 pm

      I think exactly the same!

  43. ridhoyp

    June 07, 2011 at 8:27 am

    Awesome! thank you so much…

  44. Mario Fetka

    June 17, 2011 at 7:50 pm

    thx for the update to your great script.
    one thing that always frustrated me a little is the missing support for symlinks.

    thx Mario

  45. User

    June 20, 2011 at 10:03 am

    Thank you. This has been very helpful to me

  46. tismon

    June 21, 2011 at 8:26 am

    thanks a lot dude..

  47. tanveer

    June 21, 2011 at 10:06 am

    nice web site
    i really like it

  48. hikarin

    June 25, 2011 at 12:55 am

    Thanks, nice script

  49. blepblaad

    June 25, 2011 at 11:35 am

    Nice script. Thanks.
    The script misplaces the folder icon when a foldername is long.

  50. Matt

    June 27, 2011 at 9:29 am

    Absolutely fabulous little script!!! I wrote something similar years ago to help sort out image files in directories. This is far better than what I came up with.

  51. Cagsun

    July 05, 2011 at 8:35 pm

    Great script thank you so much. Saved me a lot of time 😉

  52. Mike

    July 06, 2011 at 8:39 pm

    very nice…… thanks

  53. Darren

    July 08, 2011 at 2:08 am

    Hi,

    How would I go about putting a working delete button next to each file listed?

  54. Benjamin Flesch

    July 09, 2011 at 12:04 pm

    Hello Ash,

    the PHP Directory Listing Script contains a XSS security flaw which renders all installations of your software vulnerable to XSS attacks. I have published a patch and some information about this vulnerability here:

    http://blog.bf-itservice.de/471/evoluted-net-php-directory-listing-xss-vulnerability

    Thank you,
    Benjamin

    • team

      Stewart Doxey

      August 26, 2011 at 5:17 pm

      Hi Benjamin.

      Thanks for the information, this issue has been resolved.

      Stewart

  55. Attila

    July 09, 2011 at 5:39 pm

    Thanks, this is what I need!

  56. Chris

    July 11, 2011 at 4:43 am

    When showing the sub-directories they have an “/” on the end of them. Is there a way to not show the “/” on the end of each sub-directory?

    AWESOME script by the way!

  57. Chris

    July 13, 2011 at 11:30 pm

    Hey loving the script. I have played with it some today. I ended up making a mobile CSS for it. So now when I access it on my android it is a bare display. I am working on the pagination part of it now. Will share with you guys when I get it done. Thanks again for this!

  58. Charliefez

    July 18, 2011 at 4:28 pm

    Fantastic,
    This was obviously a lot of work and youve made my life so much easier….
    one question tho
    when i set $forcedownload = true, it allows me to download smaller files, but larger files download only as 1kb files and wont play. Im not sure if this is a problem with the php or if there is a variable im completely missing to limit the downloaded file size??
    any help would be awesome, thank you for the code!

    • Gerard

      October 06, 2012 at 6:33 pm

      Charlie, I read your post about the forcedownload in the directory listing.

      I want paople to download rather than view the file.

      Where in the script would I place the line?

      Can you help me with that?

  59. Charliefez

    July 19, 2011 at 1:33 pm

    Hi the way i fixed the width issue is purely with the css:

    first change #container to the overall desired width

    next change #headerfile to the width you want the file column to be

    then change [#listing a] to 40ish px less then your #container

    [#listing a strong] gets changed to the width of your file column

    next change [#listing a span] to the negative value of half of you file column. for example i changed [#listing a strong] to 490px, so [#listing a span] is -245px

    [#listing a em] will be tricky, you have to play around with it depending on how wide everything else is, but change it by 25px in either direction until you find one that works

    I hope i could help someone with this, if anyone could figure out the large file download issue please let me know! or that delete button feature, that would be cool although it would probably require a lot of change…

    • Don McKenzie

      July 25, 2011 at 11:15 pm

      Thanks Charliefez,

      took a little while to realize that you needed to change styles.css file.

      I gave it a try, but found a little of it was ambiguous for me, so I am hoping you can assist further.

      I wanted to extend the width by 32 characters.

      I worked my way though the listing as per your instructions, and I ended up with a wider display, but two lines for every file name listing.

      Is it possible to give actual figures that should work for me?

      It would be appreciated very much.

      one of the few things that restricts this nice little program.

      SEO friendly would be great, and Pagination.

      My page is at:
      http://www.themaximitecomputer.com/max/Programs/

      Cheers Don…

      • Don McKenzie

        July 26, 2011 at 7:07 am

        I finally sifted through it, and it appears to work:

        changes to file styles.css

        first change #container to the overall desired width
        changed from 600 to 800

        next change #headerfile to the width you want the file column to be
        changed from 320 to 520

        then change [#listing a] to 40ish px less then your #container
        changed from 568 to 760

        [#listing a strong] gets changed to the width of your file column
        changed from 300 to 520

        next change [#listing a span] to the negative value of half of you file column.
        for example i changed [#listing a strong] to 490px, so [#listing a span] is
        -245px

        changed from -151 to -260

        [#listing a em] will be tricky, you have to play around with it depending on how
        wide everything else is, but change it by 25px in either direction until you
        find one that works

        have no idea what this does.

        ==============================

        changes to index.php

        if(strlen($filename)>78) {

        changed the file name length test from 43 to 78,
        and the next line from 40 to 75.

        Cheers Don…

        • Charliefez

          July 26, 2011 at 2:15 pm

          Ok perfect im glad you got it. My setting are all here in case you still have something you want to fix

          #container {
          width: 750px;
          height:450px;
          margin-left:auto;
          margin-right:auto;
          border: 1px solid #CCCCCC;
          padding: 9px;
          background-color:#FFFFFF;

          }

          #listingcontainer {

          height:450px;
          overflow:scroll;
          background-image:url(bg.gif);
          padding: 10px;
          background-color:#E0DEDE;
          }

          #headerfile {
          text-align:left;
          float: left;
          width: 380px;
          }

          #headersize {
          text-align:right;
          width: 150px;
          float: left;
          }

          #listing a {

          display:block;
          padding: 2px 5px 2px 5px;
          font-size:small;
          color: #6285CA;
          font-family:Arial, Helvetica, sans-serif;
          text-decoration:none;
          width:710px;
          text-align:right;

          }

          #listing a strong {
          width: 390px;
          float:left;
          cursor:hand;
          cursor:pointer;
          text-align:left;
          }

          #listing a em {
          float: left;
          width: 100px;
          text-align:right;
          cursor:hand;
          cursor:pointer;
          }

          #listing a span {
          width:720px;
          position: absolute;
          margin-left: -341px;
          margin-top: -2px;
          }

          #listing a span img {
          width: 150px;
          background-color:#CCCCCC;
          visibility: hidden;
          }

  60. Alice Leuchte

    July 20, 2011 at 12:40 am

    Brilliant, gorgeous and simple! Thank you!!

  61. Ayanami

    July 21, 2011 at 9:30 am

    This php code is AWESOME !

  62. Julian

    July 27, 2011 at 11:29 pm

    Fabulous – exactly what I wanted. GREAT bit of programming !!!

  63. Don McKenzie

    August 04, 2011 at 12:53 am

    I found when the date stamp went from Jul to Aug, the alignment of the whole thing went out of whack.

    So for a 75 character file name, my full settings are given below:

    My page is at:
    http://www.themaximitecomputer.com/max/Programs/

    Cheers Don…

    =======================

    body {
    background-color: #E6E6E6;
    }

    h1 {
    color: #6699FF;
    font-family: Arial, Helvetica, sans-serif;
    font-weight:bold;
    font-size: medium;
    margin: 0 0 10px 8px;
    padding:0;
    }

    img {
    border: 0;
    }

    form {
    margin: 0;
    padding: 0;
    }

    #container {
    width: 807px;
    margin-left:auto;
    margin-right:auto;
    border: 1px solid #CCCCCC;
    padding: 9px;
    background-color:#FFFFFF;

    }

    #breadcrumbs {
    color: #6699FF;
    font-family: Arial, Helvetica, sans-serif;
    font-size:small;
    margin: 0 0 8px 8px;
    }

    #breadcrumbs a, #breadcrumbs a:visited, #breadcrumbs a:link, #breadcrumbs a:active {
    color: #6699FF;
    text-decoration:none;
    }

    #breadcrumbs a:hover {
    text-decoration:underline;
    }

    #listingcontainer {
    background-image:url(bg.gif);
    padding: 10px;
    background-color:#E0DEDE;
    }

    #listingheader {
    color: #476BB3;
    font-weight:bold;
    font-family:Arial, Helvetica, sans-serif;
    font-size:small;
    text-align:right;
    }

    #listingheader a, #listingheader a:active, #listingheader a:visited, #listingheader a:link {
    text-decoration: none;
    color: #476BB3;
    }

    #listingheader a:hover {
    text-decoration: underline;
    color: #476BB3;
    }

    #headerfile {
    text-align:left;
    float: left;
    width: 520px;
    }

    #headersize {
    text-align:right;
    width: 75px;
    float: left;
    }

    #listing {
    border: 1px solid #A7C5FF;
    }

    #listing a {
    display:block;
    padding: 2px 5px 2px 5px;
    font-size:small;
    color: #6285CA;
    font-family:Arial, Helvetica, sans-serif;
    text-decoration:none;
    width:775px;
    text-align:right;

    }

    #listing a:hover {
    background-color:#DBE6FE;
    }

    #listing a img {
    float:left;
    margin-right: 4px;
    }

    #listing a strong {
    width: 520px;
    float:left;
    cursor:hand;
    cursor:pointer;
    text-align:left;
    }

    #listing a em {
    float: left;
    width: 75px;
    text-align:right;
    cursor:hand;
    cursor:pointer;
    }

    #listing a span {
    position: absolute;
    margin-left: -260px;
    margin-top: -2px;
    }

    #listing a span img {
    width: 150px;
    background-color:#CCCCCC;
    visibility: hidden;
    }

    #listing a:hover span img {
    border: 1px solid #666666;
    visibility: visible;
    }

    #upload {
    border: 1px solid #A7C5FF;
    display:block;
    margin-top: 10px;
    font-size:small;
    color: #6285CA;
    font-family:Arial, Helvetica, sans-serif;
    text-decoration:none;
    width:568px;
    background-color: #E9F0FF;
    }

    #uploadtitle {
    background-color: #DBE6FE;
    padding: 2px 5px 2px 5px;
    border-bottom: 1px solid #A7C5FF;

    }

    #uploadcontent {
    padding: 2px 5px 2px 5px;
    }

    #copy {
    width: 600px;
    margin-left:auto;
    margin-right:auto;
    text-align:center;
    font-size:x-small;
    color: #666666;
    font-family:Arial, Helvetica, sans-serif;
    }

    #copy a {
    text-decoration: underline;
    color: #666666;
    }

    .b {
    background-color: #E9F0FF;

    }

    .w {
    background-color:#FFFFFF;
    }

    .mod {
    float:right;
    }

    .size {
    float:right;
    }

    .upload-error{
    padding:2px 0;
    }

    .upload-error strong{
    color:#993333;
    }

    • Scooby-2

      February 10, 2013 at 6:53 pm

      Thanks for sharing this, Don. A good and working mod to a good script.

  64. Dungeon

    August 27, 2011 at 2:01 pm

    Love the script – been using it for some years until I did a search to find that there’s an updated version!

    Coupla tips I’d like to see:

    1. Separate out the script into a config.php and index.php so that changing config settings “overrides” any index settings. Also, use constants (define) where possible, parametrising things like date display format, allowing uploads, optional H1 site title header.

    2. Split the CSS file into a positional (widths, font sizes) and a theme (colours, typeface, background, etc). That way people can tinker with one to change widths without breaking colour stuff – and also makes it easier for people to provide some different colour stylesheets whilst allowing sites to retain their custom widths.

    3. Last bit, but a minor one – include some changelog as an audit trail in the file. The last package I downloaded contained two index.php files with differences between them and it’s not obvious which one is the later file (both have “V3”) – consider some minor version control, v3.12 or so, or a changelog to show what differences are.

    4. Can the “$hide” array take pattern-matching at all? (eg: *.php, \.php$).

    Minor gripes to a major piece of work, guys. Looking forward to the next incarnation!

  65. Kieran

    September 01, 2011 at 2:55 pm

    sorted Ta.
    still a bloody marvellous script.
    cheers

  66. Simon Bird

    September 05, 2011 at 4:36 pm

    Excellent script – thanks for this. And thanks to Charliefez and Don McKenzie for the CSS stuff with the width adjustment – all very helpful!

  67. warren

    October 09, 2011 at 12:15 pm

    This is an excellent piece of work, Ash. Really excellent.

    It’s just what I’ve been looking for.

    Would be even better if it could also display file metadata (title, subject, author, categories, etc).

  68. Philippe

    October 12, 2011 at 11:00 am

    Thanks for this super little script, I ran into a problem with special characters in files, like ô en é, I changed the script and put utf8_decode around every mention of $files[i$] which is the filename if I am not mistaken. It would be nice to have this in one single variable like $filename, that way you only need to add the decode ones.

  69. Don McKenzie

    October 17, 2011 at 9:08 pm

    As there have been no comments for 2 months, I assume the code I posted for 75 characters is working OK.

    SEO URLs would be nice.

    Cheers Don…

  70. JASPRIT SINGH

    October 21, 2011 at 9:04 am

    Firstly i Want To Thanks the Maker.

    hello, friends i have make it some custom, hope u would like it.

    it’s simple. goto dlf folder just change the CSS file and watch it.

    ********************************

    Red Theme – Php Directory Script

    ********************************
    /* Start From Here. */
    body {
    margin-top: 1cm;
    background-color: #E6E6E6;
    }

    h1 {
    color: #ff6666;
    font-family: Arial, Helvetica, sans-serif;
    font-weight:bold;
    font-size: medium;
    margin: 0 0 10px 8px;
    padding:0;
    }

    img {
    border: 0;
    }

    form {
    margin: 0;
    padding: 0;
    }
    /* frame */
    #container {
    width: 800px;
    margin-left:auto;
    margin-right:auto;
    border: 1px solid #CCCCCC;
    padding: 9px;
    background-color:#FFFFFF;

    }

    #breadcrumbs {
    color: #ff6666;
    font-family: Arial, Helvetica, sans-serif;
    font-size:small;
    margin: 0 0 8px 8px;
    }

    #breadcrumbs a, #breadcrumbs a:visited, #breadcrumbs a:link, #breadcrumbs a:active {
    color: #ff6666;
    text-decoration:none;
    }

    #breadcrumbs a:hover {
    text-decoration:underline;
    }

    #listingcontainer {
    background-image:url(bg.gif);
    padding: 10px;
    background-color:#E0DEDE;
    }

    #listingheader {
    color: #cc3366;
    font-weight:bold;
    font-family:Arial, Helvetica, sans-serif;
    font-size:small;
    text-align:right;
    }

    #listingheader a, #listingheader a:active, #listingheader a:visited, #listingheader a:link {
    text-decoration: none;
    color: #cc3366;
    }

    #listingheader a:hover {
    text-decoration: underline;
    color: #cc3366;
    }

    #headerfile {
    text-align:left;
    float: left;
    width: 320px;
    }

    #headersize {
    text-align:right;
    width: 275px;
    float: left;
    }

    #listing {
    border: 1px solid #ff9999;
    }

    #listing a {
    display:block;
    padding: 2px 5px 2px 5px;
    font-size:small;
    color: #cc6666;
    font-family:Arial, Helvetica, sans-serif;
    text-decoration:none;
    width:768px;
    text-align:right;

    }

    #listing a:hover {
    background-color:#ffcccc;
    }

    #listing a img {
    float:left;
    margin-right: 4px;
    }

    #listing a strong {
    width: 300px;
    float:left;
    cursor:hand;
    cursor:pointer;
    text-align:left;
    }

    #listing a em {
    float: left;
    width: 275px;
    text-align:right;
    cursor:hand;
    cursor:pointer;
    }

    #listing a span {
    position: absolute;
    margin-left: -151px;
    margin-top: -2px;
    }

    #listing a span img {
    width: 150px;
    background-color:#CCCCCC;
    visibility: hidden;
    }

    #listing a:hover span img {
    border: 1px solid #666666;
    visibility: visible;
    }

    #upload {
    border: 1px solid #ff9999;
    display:block;
    margin-top: 10px;
    text-align:center;
    font-size:small;
    color: #cc6666;
    font-family:Arial, Helvetica, sans-serif;
    text-decoration:none;
    width:777px;
    background-color: #fff;
    }

    #uploadtitle {
    background-color: #ffe9ef;
    padding: 2px 5px 2px 5px;
    border-bottom: 1px solid #ff9999;

    }

    #uploadcontent {
    padding: 2px 5px 2px 5px;
    }

    #copy {
    width: 600px;
    margin-left:auto;
    margin-right:auto;
    text-align:center;
    font-size:14px;
    font-weight:bold;
    color: #666666;
    font-family:Arial, Helvetica, sans-serif;
    }

    #copy a {

    text-decoration: underline;
    color: #666666;
    }

    .b {
    background-color: #ffe9ef;

    }

    .w {
    background-color:#FFFFFF;
    }

    .mod {
    float:right;
    }

    .size {
    float:right;
    }

    .upload-error{
    padding:2px 0;
    }

    .upload-error strong{
    color:#993333;
    }

    /* Css File End */

  71. Brian Turner

    October 21, 2011 at 4:57 pm

    I added
    ob_end_flush();
    just before this line
    readfile($includeurl . $leadon . $file);
    and fixed the problem.
    I don’t know if that hoses something else.
    According to the php.net discussion on readfile that turns off output buffering and makes file transfers not dependent on PHP memory.

  72. Werner Coetzee

    October 26, 2011 at 2:33 pm

    Thought I should mention this:

    To make the script read KB, MB, GB and TB automatically instead of only KB put this function somewhere in the script
    $path = “.”; // = 1099511627776) {
    $value = round($size_in_bytes/1099511627776*10)/10;
    return ($round) ? round($value) . ‘Tb’ : “{$value} TB”;
    } else if ($size_in_bytes >= 1073741824) {
    $value = round($size_in_bytes/1073741824*10)/10;
    return ($round) ? round($value) . ‘Gb’ : “{$value} GB”;
    } else if ($size_in_bytes >= 1048576) {
    $value = round($size_in_bytes/1048576*10)/10;
    return ($round) ? round($value) . ‘Mb’ : “{$value} MB”;
    } else if ($size_in_bytes >= 1024) {
    $value = round($size_in_bytes/1024*10)/10;
    return ($round) ? round($value) . ‘Kb’ : “{$value} KB”;
    } else {
    return “{$size_in_bytes} B”;
    }
    }

    and then to change the displaying of file sizes change KB to

    And to display dir sizes the same way replace with

    Sample can be viewed at http://www.imtechnology.co.za/data/index.php, allthough I cannot gaurentee how long the sample will be kept there, as I am only borrowing the webspace from a friend for the time being. :-)

    cheers. W

    • FreaqyGeeq

      May 31, 2012 at 5:48 am

      Hi Werner.

      I’m really interested in your filesize solution here, but your instructions seem a bit incomplete. Can you please explain what needs to be changed in the existing code to enable your filesizes? Thank you very much in advance!

      FG.

  73. Modustollens

    October 26, 2011 at 5:54 pm

    Great script!

    I made a few modifications for file name size. But I don’t really need to have either the file size or date showing in the table and I could not figure out how to edit the script to not include these; perhaps you could make that into a configurable option?

    Either way – great script – far superior to one I was using for this sort of task for the last couple of years.

  74. partime

    November 03, 2011 at 4:10 pm

    Hey

    Great script, easy to configure and very clear instruction for editing.

    Thanks for the script!

  75. Mike

    November 12, 2011 at 12:09 am

    This is really awesome, thanks for putting this up :)

  76. Osowo

    November 16, 2011 at 8:46 am

    Thanks Bro! finally figured everything out.

    advice to those that want to use this script, just copy the “/dif folder and index.php file” into the directory you want to make listing directory display.

  77. Ben

    November 17, 2011 at 9:42 pm

    Many thanks for making it for everyone. It is such a great app and you put it for free!

    One question: I am going to use for listing files in different Linux boxes. Is it possible to have it to access cross other machine?

    Thanks again
    – Ben

  78. Tom

    November 21, 2011 at 5:29 pm

    Great script! Thanks!

  79. Mario

    November 23, 2011 at 10:05 am

    Great script, worked with no problems.

  80. Aden

    November 24, 2011 at 3:14 am

    Omg been looking for something like this for ages! D: thank you very much!

    • Dave

      December 04, 2011 at 7:19 pm

      My thoughts exactly!

  81. str9led

    November 24, 2011 at 12:55 pm

    Very nice script.

  82. Lucas

    November 25, 2011 at 1:34 pm

    Hello, great script :)
    Can i use it on commercial site?
    Ps. Thanks again.

    • team

      Ash Young

      November 26, 2011 at 1:14 pm

      Yes Lucas, you are free to use this on a commercial site.

      • Lucas

        November 28, 2011 at 12:45 pm

        Thanks :)

  83. bastetx

    November 26, 2011 at 1:01 pm

    Great script, have used since v1, on v3 could not get it to include in another web page no matter what .. never mind was only playing anyway, thanks for the hard work

  84. SkyLines

    November 28, 2011 at 9:51 am

    This is best script I ever used for directory listing.

    But this would be World’s Best if Pagination and Adsense ad placement below or above the list is added in future releases.

    Thanks!

  85. stan

    December 02, 2011 at 8:11 pm

    fantastic script! With only slight customizations I use the script for a private CD/DVD database. Much appreciated; all the work that has gone into this script…

  86. Dave

    December 04, 2011 at 7:18 pm

    Wow – what an absolutely fantastic script – THANKS!!!!!

    This has just become one of my favorite sites – wish I would have stumbled upon you guys sooner.

  87. Werner Coetzee

    December 14, 2011 at 8:36 am

    Hi!
    I have copied the script partially into my website. And I think I noticed something went wrong. If I have images, and anything listed beneath the images. And you move with your mouse on the file below the image, from the file name to the size, just before you reach the size, the mouse jumps up to the image’s line, and shows the image as thumbnail. I suspect its some CSS setting about width that needs to be modified, but I cannot find the correct one. Could you perhaps point it out to me?

    • Werner Coetzee

      December 14, 2011 at 1:07 pm

      I noticed the same thing with the demo. If you move your mouse to just below the last modified column, at the bottom of the listing, it jumps to the lowers image file (jpg, png etc) in the list and displays its thumbnail.
      I managed to find out which css style setting is used to move that image to the right or left, its the #listing a span, as I thought it was a spacing issue

      Any ideas on how to prevent this from happening when thumbs is enabled?

  88. VAHID

    December 22, 2011 at 10:51 am

    Really Thanks for this script.
    its really useful !!!

  89. TARIK TURAN

    January 06, 2012 at 12:30 am

    Very nice script and great job !

  90. Roman

    January 06, 2012 at 10:09 am

    Hey, thanks very much for that script!
    I use it for my intranet on a Synology DSM and helps a lot!

    Carry on like this :)

  91. Anuj

    January 08, 2012 at 5:49 pm

    Thanks to Ash Young (for Making Script) and Don McKenzie( for fixing issue for which he suggested solution).

  92. Norm Jurgen

    January 10, 2012 at 2:52 am

    I am curious if you can assist me in implementing your script to display folders and subfolders?

    Link to a development site is below:
    http://www.jjmcguire-dev.com/current-projects.php

    Requires a login & password:
    login: *****
    password: *****

    I’ve included your script in existing PHP code and set it up to scan a folder,

    $startdir =
    projects/government-municipalities/000001susanban/images/

    However, the script cannot scan sub folders.

    Any help would be appreciated.

  93. Norm Jurgen

    January 10, 2012 at 4:56 pm

    I placed a draft for you to review on,
    http://www.jjmcguire-dev.com/project-view-draft.php?project_id=1

    I am curious if I can use this product and if there is a cost associated with using it?

    Also, can you assist me in displaying subfolders?

  94. Norm Jurgen

    January 11, 2012 at 2:41 pm

    I ended up getting your script to work however it conflicted with existing PHP code (which I had to strip out). Not sure where the issues were. Never heard back from you about using your product. I kept your credits on the page. Here is a link for your review,
    http://www.jjmcguire-dev.com/bid-view-documents.php
    It is an excellent script. Thank you.

    • team

      Ash Young

      January 18, 2012 at 8:40 am

      Sorry I was a little slow with a response Norm, your page looks great.

      Just to confirm you are free to use the script as you see fit.

    • Dave

      May 14, 2012 at 12:48 pm

      Hi Norm. Your listing looks great. Can I ask how you set the width of the control? I would like the overall width of the control no more than say 5cm, currently I can’t find a width property.
      Kind Regards
      Dave

  95. MCBUrner

    March 21, 2012 at 11:37 am

    Hi. Fantastic and very helpful script. Thanks for your great work! There is just one “problem” I found – and I couldn’t fix it as yet. If there are files in a directory with more than one dot in the full file name like “whatever.date.pdf” – these files are not shown. As – in my case – there are many of those files – I would like to fix it in the script. And not by renaming all the files :-) Any ideas?

  96. MCBurner

    March 21, 2012 at 5:57 pm

    Hi. It looks like I solved it and I would like to share my changes with you guys as it might help you. Please don’t wonder – I’m not a programmer so it’s maybe “quick n dirty”.

    I changed line 319 from

    “if($showtypes && !in_array(substr($file, strpos($file, ‘.’)+1, strlen($file)), $showtypes)) unset($file);”

    to the following

    “#check the string length for full file name + type
    $get_stringlength = strlen($file);
    #get the last string right after the last dot
    $get_typestring = substr(strrchr($file, ‘.’),$get_stringlength*(-1));
    #assume that everything before it belongs to the filename and calculate the string length
    $get_typelength = $get_stringlength – strlen($get_typestring);
    #now use the knowledge about the typelength as the position for strpos
    if($showtypes && !in_array(substr($file, strpos($file, ‘.’, $get_typelength)+1, strlen($file)), $showtypes)) unset($file);”

  97. gallar

    March 26, 2012 at 12:35 pm

    Big thanks, GREAT and FANTASTIC job!

  98. Tessa Mero

    March 27, 2012 at 7:15 pm

    Very nice script. Way better than the one I found for ASP. The only thing this code is missing is a search bar. But I’m sure anyone knows how to include that. 😉

  99. 72

    April 15, 2012 at 1:35 pm

    Thanks! Works excellent!

  100. xfr

    April 18, 2012 at 4:42 pm

    FYI this script does not play nice with a symlink to a directory. It is not displayed as a directory and is offered as a 0 byte download instead.

    • Roland

      June 13, 2012 at 8:32 pm

      Yes, same problem.
      The script is great, but if I can’t use symlinks, I can’t use the script.
      @Ash: are you going to support symlinks in further versions?

      • Roland

        June 13, 2012 at 8:48 pm

        Ok, solved the problem:

        in line 303 (or so – search for “dir” with the quotation marks) you will find
        if (@filetype($includeurl.$leadon.$file) == “dir”) {

        extend this to
        if ((@filetype($includeurl.$leadon.$file) == “dir”) OR (@filetype($includeurl.$leadon.$file) == “link”)) {

        This will handle symlinks just like dirs

  101. Callum

    May 04, 2012 at 10:35 am

    Just stumbled across this script, its great. Thank you very much!

  102. Martin

    May 09, 2012 at 9:15 pm

    Thanks very much :)

  103. cahboy

    May 18, 2012 at 8:57 am

    Very nice script and so useful thanks for sharing.

  104. Mohammad Mirzaei

    June 24, 2012 at 10:20 am

    Thanks much! Very usefull script!

  105. McFire

    June 24, 2012 at 2:10 pm

    Yeah – thats it!!!
    Uploaded |dlf| and the index.php and – it works! Also in the last corner of my site!
    The only thing I miss : I’d like to store the content of the actual shown dir/subdir into a simple text file. So I could write me a little “app” to sum the bytes of the subdir.
    Or is there even planned such a count/sum function? And having it in a text it also could be helpful at work with my ftp.
    Greetings and thanx for this script.

  106. Henrik Bechmann

    June 24, 2012 at 6:04 pm

    Nice script Ash, but apparently the styles.css “#listing a strong” at line 113 needs a “white-space:nowrap” rule added to avoid a word wrap on a hyphen for a long file name. Such a wrap/break causes following formatting to get mangled.

    Hope this helps.

    – Henrik

    • Henrik Bechmann

      June 24, 2012 at 6:18 pm

      Also it appears that

      overflow:hidden;
      text-overflow:ellipsis;

      works for listing a strong instead of truncating the filename.

      – Henrik

  107. McFire

    July 05, 2012 at 11:44 pm

    I’ve changed some things in styles.css , so it’s extendet now to 900px. With the help of some hints from here it was done successful. Also changed the assiciated pts in index.php to 75 resp. 72 . But despite of having more space now the filenames doesn’t expand. What is to do?

  108. McFire

    July 06, 2012 at 1:50 am

    Fixed a selfconstructed bug, now it runs correct. And here I’ve set a picture with all needed stuff for expanding the dir window.
    http://www.letterchip.de/kramkiste/dirliststructure.gif
    So you have all at one single point.
    Thanks again to all helpful hint writers here.

  109. Sandor

    October 22, 2012 at 11:01 am

    It would be great if the script could show directory headers. Maybe in a new version? 😉

    • team

      Ash Young

      November 06, 2012 at 11:16 pm

      What do you mean by directory headers?

      • Sandor

        November 07, 2012 at 8:31 am

        An html file (i.e header.html and footer.html) with text to display in header and footer of the directory listing.

        It would also be interesting files.bbs or descript.ion support, for files comments… :-)

  110. Ron

    November 28, 2012 at 11:22 am

    Much appreciated. The exclude list is maybe its best feature making it easy to limit a user to only the file types we want them to see. I may eventually add code to GET[..] a variable and so modify the exclusion list depending upon login.
    Thank you very much for your hard work.

  111. Mark Jones

    December 03, 2012 at 6:12 pm

    Excellent script! Thanks for the time and effort you guys put into it.

    I was just wondering if anyone has worked out how to implement a delete button?

    Thanks,
    Jonesy

  112. Mark Jones

    December 04, 2012 at 1:50 am

    Figured it out!

    So, to add a delete option to my file listings output I just added another link right after the file link. The href in the new link contains this php echo statement:

    echo strip_tags($_SERVER[‘PHP_SELF’]).’?deletefile=’.$fileurl;

    And in the same index.php file I added this php coding:

    if(isset($_GET[‘deletefile’])){
    $deletefile = $_GET[‘deletefile’];
    unlink($deletefile);
    }

    I also added some additional styling to get everything lined up properly. For my specific purposes I already had security protocols in place so the DELETE link is only available to specific logged in users.

    Hope this helps!

    Jonesy

  113. Martin Clay

    January 05, 2013 at 5:03 pm

    Hi guys, this script is great. It’s the best one I’ve found so far. I’m using it to list mp3 file on my DJ site. Just one issue however, if the file name has more than one . in it , then that file is not displayed. I’m going to write a bit of code to take all .’s out of my file names but it would be good if you could consider a possible fix. Thanks again for a great free script !

  114. Steve Rance

    January 12, 2013 at 12:06 am

    The best solution out there, thanks Ash. Modified it for my requirements however. http://fairlightus.com/Downloads

  115. Scooby-2

    February 10, 2013 at 7:02 pm

    Thanks for a great script. Our site is non-profit making so it’s great to see a professionally written program like this made freely available.

  116. Toby

    February 23, 2013 at 12:07 am

    Dear Ash
    Very usefull! I would like to donate, but you refused 2 years ago – If you change your mind – let me know.
    Anyway – thanks a lot for this script and best wishes from Switzerland
    Tobias

  117. helikun

    March 21, 2013 at 3:09 pm

    Thank you very much.your code great.
    ^_^

  118. William Becher

    April 16, 2013 at 3:40 am

    Hi, great script. I’ve used this for my personal use. Can I modify the code and add some modifications to the script?

    • team

      Evoluted New Media

      April 26, 2013 at 11:01 pm

      Yes, that’s absolutely fine!

  119. Dildo P

    June 27, 2013 at 10:36 pm

    Thank you very much for this!

  120. Jason

    June 28, 2013 at 9:34 pm

    Awesome script!

    Thanks for providing this.

  121. ratul

    May 06, 2014 at 6:44 am

    really very helpfull…. i change my www folder to a custom path just put in script and it shows the directory listing……….

    thank you

  122. John Mosow

    November 04, 2015 at 5:02 pm

    I love this new script. but I am having a problem opening files. When I click on a pdf file, I get the following:

    The requested URL /Members/Index.phpDocuments/Board Meeting Minutes/2015/PLA Board Minutes – 01-2015.pdf was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Not sure why the url is incorrect for the document. My start directory is set to ‘Documents’ and I have tried the includeurl both ways.

    Any help is appreciated.

    • team

      Rick Mills

      November 05, 2015 at 11:07 am

      Hi John,

      Looks like we had a bug there! We’ve just published an updated version to correct the issue. If you re-upload the index.php file from the new version and enable the includeUrl option you’ll be able to fill out the URL to use as the base location.

      • John Mosow

        November 11, 2015 at 3:31 pm

        Rick, thanks for looking into this. I put the new php script in place and made the changes but it is not acting as I want. Off my web root, I have folders Members/Documents. I have put the script into the Members folder. Here are my settings:

        public $startDirectory = ‘Documents’;
        public $includeUrl = true;
        public $directoryUrl = ‘http://pinelakeassociation.com/Members/Documents’;

        When I click on one of the folders listed on the page, it is bringing up something completely different.

        Also, I do not want anyone viewing any folders above the Documents folder. I assume I would need to put the index.php in the Documents folder.

        Suggestions on what is happening and how to get what I am looking to do?

        Thanks

        • team

          Rick Mills

          November 11, 2015 at 3:53 pm

          Hi John,

          Sorry to hear you’re still having some issues.

          So you want to make it so that if someone browses to yoursite.com/Members, they are presented with the directory listing script, which will show only the contents of yoursite.com/Members/Documents

          One thing I did notice is your directory url – this would need to be set to the location of where the index.php file is. Links would then automatically be worked out to be inside the Documents folder as this is set on your startDirectory setting.

          Other than the directoryUrl your settings do look correct. Give this change a try to see if it rectifies the issue for you. If you’re still having issues after this please let me know and we can try a few other options.

          • John Mosow

            November 11, 2015 at 5:52 pm

            I think I finally got it to work as I need it to. Just a bit more tweaking and hopefully it will all be good. Thanks for the help.

        • Muhammad Firdaus

          November 11, 2015 at 6:06 pm

          Hi John Mosow, I am in the same situation as yours.
          I have directory like this:
          /public_html/folder/anotherfolder

          I put index.php in /public_html. Because of that, user can browse to /public_html and /public_html/folder.
          I want to jail user only for /public_html/folder/anotherfolder, but cant figure out how to do it.

          • John Mosow

            November 11, 2015 at 6:11 pm

            First, I put the script in the base folder that is to be browsed. So in my case, I put the index.php in my Documents directory which has subfolders and files I want to show. Here are the settings in the script:

            public $startDirectory = ‘.’;
            public $includeUrl = true;
            public $directoryUrl = ‘http://pinelakeassociation.com/Members/Documents/’;

            Now everything is working as I need it to.

            FYI, I put some code in this to get the user name for my password protected directory. If they are an admin, they can do all of the folder/file maintenance. Otherwise, the user can only browse and open files.

          • John Mosow

            November 11, 2015 at 6:13 pm

            One other item, I have my Members folder password protected but not the Documents folder. This way, they have to log in to get to the script but only need to log in once.

  123. Muhammad Firdaus

    November 09, 2015 at 4:11 pm

    Hi. This is a great script.
    How can I make it show file size? Im viewing it on mobile and it just show me the filename.

    • team

      Rick Mills

      November 11, 2015 at 3:45 pm

      Hi Muhammad,

      As default we’re hiding non-essential columns on mobiles as it’d cause the screen to scroll to the side on smaller screens.

      You can however change this behaviour. If you open up the index.php file and search for:

      class=”text-right xs-hidden”

      You can change this to

      class=”text-right”

      This will make the file size show on all screen sizes. Similarly you can also remove the sm-hidden from the last modified column to show that on small screens.

  124. Muhammad Firdaus

    November 11, 2015 at 4:22 am

    Any user that can access that script can browse to all dir in system. Just type something like dir=/home, then they can see all home dir..
    Can you make it limited only to specified dir?
    like if I set dir to /home/test/dir, they cannot go to /home/test, or to /home

    • team

      Rick Mills

      November 11, 2015 at 3:43 pm

      Hi Muhammad,

      We’ve just released an update (4.0.3) that’ll correct this, along with a few other issues – many thanks for letting us know!

      • Muhammad Firdaus

        November 11, 2015 at 5:42 pm

        Thanks a lot for this!!

      • Anders Skjoldebrand

        January 02, 2016 at 3:18 pm

        Hi Rick,

        This is really a fantastic script and a very nice upgrade from version 3.

        Questions:
        How can we tell which version is out there to be downloaded?
        I can tell my currently downloaded version is 4., nov 11 2015.
        Then I also see version 4.0.3 being mentioned in your post on the same date?

        I also noticed the the VIEWPORT arguments produces an error – not being recognized since they were separated by “;” instead of “,”. I use OS X Safari.

        Would it make sense to also include a default setting or placement in the code for the “date_default_timezone_set” since servers tend to complain.

        Also a nice addition would be to have ( “UTF-8” in my case ) placed in the code. This would make it easier to remember.

        Anders

        • Anders Skjoldebrand

          January 03, 2016 at 11:44 am

          Rick,
          There appears to be no need for the charset option since UTF-8 is supposedly default in HTML5 and that seems to work correctly. My mistake!

          However, I stumbled over filenames starting with e.g.

          Ö 214 00D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS
          Å 197 00C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE
          Ä 196 00C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS

          These are all typical Swedish characters.
          These filenames show up in the listing WITHOUT the starting character and are also not found when clicked upon. (404 not Found)

          If the same character ( upper or lower case) appears anywhere else in the file name it works fine.

          Any suggestions why this happens?

          Tested with Safari, Firefox and Chrome.
          PHP is 5.6.16

          Anders

  125. John Mosow

    November 12, 2015 at 2:25 pm

    I would like to split the script out to make it easier to manage. For example, I would split the user settings into one file and the sections with the image coding into another. This would make it 1) easier to implement new versions of the script without having to reenter my custom settings and 2) make it easier to use with online editors. The script is so large that my online editors have a tough time with this. Any suggestions on how to do this or would you be willing to split it up as part of your standard package?

    • team

      Rick Mills

      November 20, 2015 at 10:52 am

      Hi John,

      That’s an interesting idea. The script was originally designed to be compact so that you could just drop a single file into a directory and be ready to go.

      Offering an ‘advanced’ version that’s split out may be something we can look at for a future update.

      If you’d like to attempt it yourself, the first thing I’d do is move the DirectoryListing php class at the top of the file into it’s own php file. Then including it into the index file.

      You could then also move the CSS and Javascript out into their own files. This’d leave you with a fairly small index file.

      Alternatively, if its just the settings you’d like to move out, simply create a new php file (say ‘settings.php’) and create an array of your settings inside it. Then include this file at the top of the index.php file, and update the variables to retrieve the values from your settings file.

      So if you had an array that had, for example:

      $settings = array(
      ‘startDirectory’ => ‘files’
      );

      In the index file you’d update $startDirectory to be:

      $startDirectory = $settings[‘startDirectory’];

      Remembering to include the settings file at the top with:
      include(‘./settings.php’);

  126. John Mosow

    November 17, 2015 at 8:12 pm

    I would like to change the color of the font in the directory listing but cannot seem to find where it is. Any help would be appreciated.

    • team

      Rick Mills

      November 20, 2015 at 10:45 am

      Hi John,

      The script’s using a bootstrap theme called ‘Yeti’ hosted at bootstrapcdn.com

      You can either change the URL to another bootstrap theme, or if you’d prefer to manually override the text colour, add your own CSS at the bottom of the page just before the tag.

      If you wanted to for example change the link colour, adding this will change it to red:

      a { color: #ff0000; }

      If you’re unsure on the colour hex, a tool such as http://www.colorpicker.com/ can be used to get the hex value you’d like to use.

      • John Mosow

        November 20, 2015 at 4:23 pm

        Thanks. I want to try to just change the link color. I made the following change but it does not make a change in the output.

        <a {color:#fff000;} href="” target=”” class=”item _blank “>

        When I inspect the element in my browser for the file name, I can see the color tag in there.

        • team

          Rick Mills

          November 20, 2015 at 4:51 pm

          Hi John,

          Looks like you’re missing your style tag there. Try this instead:

          <a href="" rel="nofollow" class="item _blank " style="color:#fff000;">

          • John Mosow

            November 20, 2015 at 5:17 pm

            Admittedly, I am not html programmer. Here is the changes I made. The icon no longer shows as a pdf icon for my files. And the file link is showing in yellow.

            <a href="” rel=”nofollow” target=”” class=”item _blank” style=”color:#fff000;” “>

          • team

            Rick Mills

            November 23, 2015 at 10:08 am

            Hi John,

            Looks like you’ve got an extra double quote at the end of your line there – it’ll be causing the browser to confuse where the html tag ends. Change it to this and you should be all set:

            <a href=”” rel=”nofollow” target=”” class=”item _blank” style=”color:#fff000;”>

          • John Mosow

            November 23, 2015 at 5:48 pm

            I have tried a number of variations of this and still no luck.

            With this line, the text is in blue and the file icon is just a regular text icon:

            <a href="” rel=”nofollow” target=”” class=”item _blank” style=”color:#fff000;” “>

            This is the original code:

            <a href="” target=”” class=”item _blank “>

  127. Brian

    November 19, 2015 at 9:52 pm

    I’ve installed the latest version of your script, and I can get the page to come up, but no matter what I set for my starting directory, the script keeps showing “this directory does not contain any files”

    What am I doing wrong? My permissions should be all correct. I can run a different index.php directory listing script across this directory and it displays everything just fine.

    • team

      Rick Mills

      November 20, 2015 at 10:38 am

      Hi Brian,

      You may find you need to tweak the value in your $startDirectory value.

      Lets say your index.php is located at yoursite.com/files/ but you want to show files located at yoursite.com/downloads/ you’d need to set $startDirectory to ‘downloads’. Alternatively, if you leave the $startDirectory field blank, it’ll show files wherever your index.php file is located.

      One final thing to check is permissions on the files, along with the file types – there’s a list of file types that’ll be hidden, so if for example you’ve got php files they’ll be hidden as default. You can change this by editing the $ignoredFileExtensions variable.

      If you’re still having issues after trying these options, could you let me know your folder names and locations in relation to the index.php file to help work out why your files aren’t showing.

      • Brian

        November 20, 2015 at 8:07 pm

        I have my index.php file located at the root of my site and there are a bunch of folders at the root of the site. Inside the folders, are a bunch of PDFs that I want to display (and sub folders).

        The only way I can even get the script to show up anything when I pull up the site is to enter the complete folder path in the “startDirectory” variable. If I leave it at “.” I get nothing. I have left ignored files at the default setting.

        Apache has ownership of all the files and directories here and I don’t think there is a permissions problem. Other, similar php scripts display everything just fine.

        Thoughts?

        Thanks for your help.

        • team

          Rick Mills

          November 23, 2015 at 10:19 am

          Hi Brian,

          Very odd – I can’t seem to replicate the issue you’re having at all here. If you drop the “.” from the startDirectory you’ll likely see no files, however with it, you should be seeing files and/or directories there unless the $showSubDirectories variable is set to false.

          Could I ask what your server setup is like?
          – Linux or Windows
          – Apache (or other httpd server) version
          – PHP Version

          Hopefully I can then set up a matching environment here and replicate the issue and get it fixed for you.

          Thanks

          • Brian

            December 02, 2015 at 9:11 pm

            I am running:

            – SLES 11 SP4 (Linux)
            – Apache 2.2.12-59.1
            – PHP version 5.3.17-48.1

            Thanks for checking into this

          • Brian

            December 08, 2015 at 5:49 am

            Any luck in replicating my problem or have any other thoughts as to why I can’t get script to work?

            Thanks

          • team

            Rick Mills

            January 04, 2016 at 1:09 pm

            Hi Brian,

            Any chance you could post a list of installed PHP extensions on your server. I still can’t seem to replicate the issue here so hopefully I can match up your setup as close as possible to see if there’s potentially a minor difference in your PHP setup that could be causing the issue.

  128. Brian

    November 25, 2015 at 6:09 am

    I am running:

    – SLES 11 SP4 (Linux)
    – Apache 2.2.12-59.1
    – PHP version 5.3.17-48.1

    Thanks for checking into this

  129. William Mocahbee

    November 27, 2015 at 2:43 am

    How do you change the footer blue to another color?

    • team

      Rick Mills

      February 02, 2016 at 4:06 pm

      Hi William,

      Do you mean the blue footer link text? This can be changed by adding css into the header section or by including your own stylesheet.

      A quick example of overriding the link colour would be:

      a { color: #FF0000 !important; }

      Placed just before the tag, this will set all links to red.

  130. Artuom

    December 08, 2015 at 5:11 pm

    Hello, please tell me how to correct the encoding? I have all the files in the Cyrillic alphabet.

    Also interested in the opportunity to download an archive folder.

    DEMO: http://school4.org.ua/dir/test/

    • team

      Rick Mills

      January 04, 2016 at 1:13 pm

      Hi Artuom,

      Looks like it’s loading correctly now as it’s showing the correct Cyrillic character set.

      • Artuom

        January 04, 2016 at 1:24 pm

        please tell me how to download the folder as an archive ?

  131. John

    December 09, 2015 at 8:25 am

    Eccellent work, ash! I like how you put everything you need in a single index.php script, even bootstrap. This is magic.

  132. AlzamyA

    December 18, 2015 at 8:45 am

    anyone can help me ? i use this script for my directory, when i try uploading rar and zip file it say error file type blocked, i already add the media type into script, but same error appear, maybe someone know how to fix this ? i am using latest evoluted directory listing version thanks

    • team

      Rick Mills

      January 04, 2016 at 12:59 pm

      Hi AlzamyA,

      Zip files should already be supported as the correct MIME type for these is already in the $allowedUploadMimeTypes array.

      Could you check that the file you’re uploading is a valid zip file and not a proprietary file type.

      Your zip file mime type should be application/zip.

      To add support for rar files, add the following two entries the above mime type array (around like 105 in the index.php file)

      application/x-rar-compressed
      application/x-rar

  133. Feckie

    December 19, 2015 at 8:34 pm

    I get the following

    Fatal error: Class ‘finfo’ not found in C:\LiveWebSites\1.Evoluted-Directory-Listing-Script\index.php on line 672

    in the new version

    • team

      Rick Mills

      January 04, 2016 at 12:55 pm

      Hi Feckie,

      You’ll need to enable the fileinfo extension in php. This should resolve the issue you’re having.

  134. magnetux

    January 04, 2016 at 7:18 am

    same problem here, i got the same problem with brian,
    – Windows 7 Pro 64 bit
    – Apache 2.4
    – PHP Version 5.6.15

  135. magnetux

    January 04, 2016 at 7:36 am

    i got my own solution, here is my solution, just edit php.ini and uncomment this line:
    extension=php_fileinfo.dll
    Remember to restart Apache for new php.ini to take effect.

    It work for me !!!

    Thank You.

    • team

      Rick Mills

      January 04, 2016 at 1:11 pm

      Glad you’re all up and running now Magnetux :)

      • Brian

        January 04, 2016 at 11:01 pm

        I installed the fileinfo extension for PHP and now it appears my problems are also solved. I will test to confirm later, but I can now see files. Thanks so much for the tip magnetux and thank you Rick for all your help!

  136. Brian

    January 06, 2016 at 9:46 pm

    Got the script to show files. I can create sub directories. I can upload files except for PDF’s. I have not blocked PDF file extension in the script and it is an allowed file type. I can upload other files, like Word documents, but when I upload a PDF it tells me “Your file could not be uploaded as your file type is blocked”. Where should I look to fix this?

    • bastetx

      January 30, 2016 at 10:10 pm

      also have this issue, jpg uploads fine, but when it comes to pdf docs {which have been allowed}
      no way … slightly mystified

    • team

      Rick Mills

      February 02, 2016 at 3:59 pm

      Hi Brian,

      The latest version uses a slightly more reliable way of detecting the file mime type. Could you see if this addresses the issue with PDF’s?

      If you are still having the issue, could you let us know what application was used to create the PDF’s as it could be that it’s an issue with certain PDF types.

  137. Anders Skjoldebrand

    January 08, 2016 at 12:49 pm

    Hello,

    With the new version 4 script I stumbled over filenames starting with e.g.
    Ö 214 00D6 Ö LATIN CAPITAL LETTER O WITH DIAERESIS
    Å 197 00C5 Å LATIN CAPITAL LETTER A WITH RING ABOVE
    Ä 196 00C4 Ä LATIN CAPITAL LETTER A WITH DIAERESIS

    is missing the first character in the listing.

    These are all typical Swedish characters.

    These filenames show up in the listing WITHOUT the starting character and are also not found when clicked upon. (404 not Found)

    If the same character ( upper or lower case) appears anywhere else in the file name it works fine.

    Any suggestions why this happens?
    Tested with Safari, Firefox and Chrome.
    PHP is 5.6.16
    Anders

    • team

      Rick Mills

      February 02, 2016 at 3:56 pm

      Hi Anders,

      We’ve released an update (v4.0.4) to address the character encoding issues. If you upload the latest version it should fix this issue for you.

      • Anders Skjoldebrand

        February 04, 2016 at 6:44 pm

        Rick,
        With the 4.0.4 leve of the script there is still an issue with file names starting with non-ASCII characters. Sent some support info on “info@ ..”
        Also it appears that filtering of files, such as those of the type “.php” are displayed when navigating down 2 levels of sub-folders. It seems to work at the starting level and next level down.

        Anders

  138. Roger Bennett

    January 09, 2016 at 12:24 pm

    Hi great script I updated to new version as the zip files started to download corrupted ..

    On the new version I get
    Fatal error: Class ‘finfo’ not found in C:\LiveWebSites\feckie_games\Downloads\index.php on line 672
    which is
    $fi = new finfo(FILEINFO_MIME_TYPE);

    Can you offer any assistance

    installed on win 8.1 tried on 10 same on that as well

    Roger

    • Roger Bennett

      January 09, 2016 at 12:42 pm

      Please Ignore all I wrote

      After looking at the script I realised that i had to allow info in php.ini

      Great Script

      Regards

      Roger

  139. Harinath

    January 22, 2016 at 7:41 am

    hello,

    Every thing is working Fine but in my subdirectories i have multiple pdf files so how can i make them to display to users

    • team

      Rick Mills

      February 02, 2016 at 4:02 pm

      Hi Harinath,

      Assuming the file permissions are correct, your pdf files should be visible. There was however an issue with PDF’s which has now been addressed in the latest release (v4.0.4).

  140. Brian

    January 22, 2016 at 9:28 pm

    Is there a way to hide the “Last Modified” column?

    • team

      Rick Mills

      February 02, 2016 at 3:54 pm

      Hi Brian,

      You’ll need to make a minor modification to the script to do this however it’s fairly easy to do.

      Using the latest version, scroll down to around like 1097 and you should see a line like this:

      <td class=”text-right sm-hidden”><?php echo date(‘M jS Y \a\t g:ia’, $file[‘modified’]); ?></td>

      Comment out or remove this line. The just slightly further up you should see this:

      <a href="sortUrl(‘modified’); ?>”>Last Modified <span class="sortClass(‘modified’); ?>”>

      Again, comment out or remove this. This will remove the entire last modified column from display.

  141. David Xie

    January 26, 2016 at 7:50 pm

    Hi There,

    Thanks a lot for the work. I used it. It works good. Though, I had to make some changes to this script.

    1. I need to make the script to have password for admin users, and admin users can login and do delete/create. Public user cannot do anything except for viewing.

    2. I make the page to support UTF-8, so that binary language can be supported.

    There is no way to upload the updated PHP file, but if you need it, please send me a email, I will mail to you.

    I return this updated script is just to appreciate your work.

    thanks a lot!

    Dave

    • team

      Rick Mills

      February 02, 2016 at 3:52 pm

      Hi David,

      Sounds like you’ve made some great additions there! We’ve added the UTF-8 update into the latest release (4.0.4) however don’t yet have separation between visitors and admins.

      If you would like to send it to use for potential inclusion in a future update, please do feel free to email me (rick at evoluted.net).

    • John Mosow

      February 02, 2016 at 4:26 pm

      I also needed to distinguish between and admin and a viewer. As I recall, I created a function to set the options for an admin and then ran the function if the logged in user was an admin. I use the folder access user for my username. Hope this code helps, I am no programmer.

      if ($username == “AdminUser”) {
      $listing ->setadmin();
      }

      public function setadmin() {
      $this->enableDirectoryCreation = true;
      $this->enableUploads = true;
      $this->enableFileDeletion = true;
      $this->enableDirectoryDeletion= true;
      }

  142. Robert

    January 28, 2016 at 7:38 am

    It would be better if you replaced the variables $file[‘type’] value to equal to mime_content_type($file[‘tmp_name’]) as it provides a more valid mime-type based on the server rather than the browser/client in the __processUpload function.

    • team

      Rick Mills

      February 02, 2016 at 3:50 pm

      Thanks Robert,

      We’ve just posted an update that includes this change.

  143. Irfan Alam

    January 28, 2016 at 8:13 am

    BUG: If Folder or Sub Folder contain ‘&’ in their name then contents inside that folder are not visible. It says “This directory does not contain any files.”

    I have more than 500 folders which contain & in their name and it is not possible to rename all manually.
    How to solve this problem??

    • team

      Rick Mills

      February 02, 2016 at 3:49 pm

      Hi Irfan,

      Thanks for letting us know about this issue. We’ve just released an update (version 4.0.4) that fixes this.

      • Irfan Alam

        February 03, 2016 at 3:40 pm

        It is working for current folder but when it enters that folder then the link is again getting changed back to ‘&’ instead of %26

        For Ex: There is a folder >>index/folder&one/folder&two/folder&three
        and I am at index level.
        The link for the first folder is showing like this http://myweb.com/index/folder%26one
        So clicking on this is working fine.

        Now I am in folder&one and wanted to enter folder&two
        The link for the second folder is showing like this
        http://myweb.com/index/folder&one/folder%26two
        So clicking on this is leading me to folder >> index/folder
        Which is not a folder and hence showing no file in it.

        Manually entering like this http://myweb.com/index/folder%26one/folder%26two is working fine.

        Now I am in index/folder&one/folder&two and wanted to enter folder&three
        The link is showing like this
        http://myweb.com/index/folder&one/folder&two/folder%26three
        Clicking on this is leading me to folder index/folder
        which is not a folder.

        Please look on this!

        • team

          Rick Mills

          February 08, 2016 at 1:01 pm

          Hi Ifran,

          We’ve released another update (4.0.5) to address this issue.

  144. Shah

    January 28, 2016 at 7:19 pm

    have you added any facility to also download seelcted or all files in form of zip or normal download.???

    • team

      Rick Mills

      February 02, 2016 at 3:48 pm

      Hi Shah,

      This isn’t something that the script currently supports however it is something we can look at for a future update.

  145. seb

    January 30, 2016 at 10:28 pm

    hello,
    the script dont support “é” and “à” in folder or file name… how to ?
    Thank

    • team

      Rick Mills

      February 02, 2016 at 3:47 pm

      Hi Seb,

      It sounds like your server isn’t set up for UTF-8 encoding. We have released a minor bugfix update that sets the UTF-8 encoding heading in the script, however if you’re still having issues after updating then it’s likely going to be a hosting/server issue.

  146. George Spelvman

    February 04, 2016 at 4:19 pm

    I searched for hours for a simple directory listing script with upload capabilities. This is elegant yet simple and delivers exactly what I need. Thanks so much!

  147. Anders Skjoldebrand

    February 04, 2016 at 11:17 pm

    Rick,
    Unexpected behavior ….
    I have turned of all options to allow upload, delete files and directories … IOW only subdirectories and files are visible.
    This work fine on the initial folder, but as I move down to the next subdirectory, all the options I turned off are now visible.
    And as I move down one subdirectory further, all options are visible and on top of this files with e.g “php” are starting to show up.
    Is this in any way dependent upon how the “startdirectory” or “$includeUrl” options are set?

    Anders

  148. Anders Skjoldebrand

    February 04, 2016 at 11:23 pm

    Rick,
    After the 404 update of the script, these is still an issue with file names starting with non-ASCII characters, as described in my original posting on UTF problems.
    I did not know how to relay support info, so I sent a mail to your “info@ …” with traces.

    Anders

    • team

      Rick Mills

      February 08, 2016 at 12:53 pm

      Hi Anders,

      Thanks for your email. We’ve just released an update (4.0.5) with additional special character support. I’ve tested this with the filenames you provided in your email and they now link correctly.
      We’ve also corrected the issue you were having with hidden files being incorrectly displayed in sub-directrories

      • Anders Skjoldebrand

        February 11, 2016 at 12:12 pm

        RICK,

        Yes, the unwanted files have now been suppressed with version 4.0.5.
        Unfortunately, the file names starting with non-ASCII characters are still missing their first character and cannot be displayed.
        Also, when options, such delete and upload files, are turned off in the script, they are certainly hidden at the top level, but as you move down a level to the next subdirectory, they appear as if they have never been turned off.
        I tried to document this in a mail to “info@ ..”.

        Anders

  149. seb

    February 08, 2016 at 2:18 pm

    hello,
    Thank for the new version but now I have this error :

    Warning: filetype(): Lstat failed for F:\FILMS-SERIES-MP3\La petite Sir?ne.mp3 in F:\FILMS-SERIES-MP3\MP3\index.php on line 658

    do you have a solution please ?
    Thank

  150. Brian

    February 08, 2016 at 5:57 pm

    With the new version of the script, I cannot get files to display properly. With the older version (4.0.3 I believe), I did not have to set “startDirectory” variable or any other variables, but now it appears I do need to set them just to get the script to appear, and even then I get now file/folder listings. Thoughts? I am reverting back to older version for now while I do more testing.

    Thanks!

  151. Irfan Alam

    February 08, 2016 at 7:45 pm

    How to show Download Count for files?
    Is there any plan to add this in future?

Leave your comment