File Download Snippet

I needed an easy way to display files from a folder for downloading. So I created this snippet for Modx. By passing in a folder it outputs the filename, date, size, link, filetype image, description, and the download count.

07-17-06 Fixed code that determines which file type image to use with each file.

04-30-06 The files have been updated to allow for directory browsing. This allows the user to go into subfolders of the folder specified in the snippet call. I have also cleaned up some of the code.

03-22-06 I have added the ability for single file listing. The updated files can be downloaded here. There is a new parameter for this - &getFile=``

03-18-06 There was an error in the file download.php, it was causing the downloads to fail. It should work correctly now and can be downloaded on the right.

Comments
If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code:
 
Required fields are marked with *.
Comment

7

kmaqntix kmaqntix Tue November 06, 2007, 13:26:16

<a href="http://auxphvks.com">befkmbza</a> naowcqer http://jbxshuui.com gcylixgj lxtlcvdn [URL=http://brqstjja.com]vvtopntp[/URL]

Comment

6

0ad Tue July 11, 2006, 05:00:00

very very handy, thank you!

Comment

5

Using an external link kjaebker Fri June 23, 2006, 12:23:00

Due to the php functions I am using to process the files they must be located on a local server.

Comment

4

upurii Wed June 21, 2006, 03:46:00

Its possible to use an externe link for the folder path ?

Comment

3

Just keeps getting better and better! doze Tue May 02, 2006, 00:00:00

These snippets just keeps getting better. Now with directory browsing too, great work!

BTW. Nice site setup! :)

Comment

2

Great work! Zaigham Wed April 26, 2006, 00:07:00

Great work man!

Thanks for the snippets.

Comment

1

Damn... I love your snippets. Scotty Delicious Fri March 24, 2006, 23:15:00

I am now using both the snippets you have here on my site. Thanks for making these public!

logoLeaving tracks across the web.