I-Am-Bot Code, technology and life

dScript

Update: A minor bug, which breaks the (+) icon next to a folder when no files/folders are present in the parent directory fixed. Thanks to Przemysław Kłys for reporting it. Compressed the JS file for smaller package size. Cleaned up a few lines. As usual get it here

After the first releaseof my simple php download counter script, I present a new improved
version! It is a complete rewrite, with a better interface and cleaner
code.Its written in php/javascript/css.

You can watch a demo here.

Minimum Requirements :

A web server that supports php. User should have write permissions to the directory.

Installation Notes :

1. Download
2. Unzip in your webserver http://example.com/path
3. chmod /path/Includes/log to 777
4. Drop files/folders and use!
5. Directly link files as http://example.com/path/download.php?fname=<./path to file>

Features :

1. Tree like listing of all files and folders within the directory.
2. No hassles with changing folders. Just expand the folder, and click on file.
3. No database required. All stats are stored in log file.
4. Icons displayed for most file types.
5. XHTML and CSS valid code.

Tested with Firefox 2,3 Opera, Chrome, Safari, and IE 7.

Bugs :

1. Displaying file size and downloads for nested files is broken. Needs formatting.

Credits :

Read file readme.txt

Terms:

Should work reasonably well on most servers. No guarantees
whatsoever! You can modify and distribute as you like. But please make
sure the readme.txt file is present when you distribute it.

All comments and suggestions welcome. Email : srinath [AT] iambot [DOT] net

Comments (9) Trackbacks (1)
  1. Hallo,

    I have followed your instructions, as described, but having trouble making this script work, as I do not have much experience with these scripts, I kindly ask you to help me out…

    - I have downloaded put your on my site, in : http://bonica.be/dscript – check yourself, it is there
    - I have changed http://bonica.be/dscript/Includes/log to 777
    - I have uploaded the files I want to share to http://bonica.be/downloads
    - I have tried to link to these files both with
    http://bonica.be/dscript/download.php?fname=
    and
    http://bonica.be/dscript/download.php?fname=

    That much I know how to do… but the script tells me it doesn’t find any file.

    Obviously, I do not know how to link to my files, or the folder i have put them in isn’t the right one ?

    Thanks and Best Regards,

    Nico

    • @Nico, you need to put your files in the same directory as the script. That is, in the dscript directory. Then if you visit the link, you will see the files listed there.

      • Hi,
        As a matter of fact, I would like to put the script into the download directory.
        I will do so and keep you updated.
        As for the link, I still don’t know if I have to put the www or simply http … ?

        Kind Regards,

        Nico

  2. Sorry, in the hurry, I didn’t even realize what stupid nonsense I wrote…
    Of course, if the files and script are in the same folder, you don’t need any www’s or http’s to link to the download files.
    As promised, will keep you up to date.

    Nico

  3. Hallo,

    Sorry to bother you again, but I simply cannot make this darn thing work.
    I have tried all imaginable file paths, but all I get is either ‘page not found’ or ‘invalid file name’…

    To resume :

    - script and files are in http://bonica.be/downloads/ – check out, they are there…
    - I want to track downloads for the file named pcad2011proEN.exe
    - How should the file link (step 5 in your installation notes above) look like ????

    Thanks for helping me out.

    Regards & a nice weekend,

    Nico

  4. Works now.

    Thanks a lot !

    Nico

  5. A question on this link I see referred to above. I have an audio folder with 800 mp3s in it. Would I have to link to each of them, or can I set this up to just track all files inside a given folder?

    Thanks.


Leave a comment

(required)