FileDownload 2.5

Last week it was discovered that the file download.php that was included with the FileDownload snippet could be exploited to download any file. After a qucik fix was released, I looked for a better way to increase the download security. After doing some searching on different methods of securing downloads, I decided it would be best just to use facilities provided by MODx.

Before diving in and writing my own solution I checked out the MODx repository and found a plugin created by Adam aka ONO that did exactly what I was looking for. The plugin takes the path from a template variable, so all the user ever sees is the name of the file they are downloading. Using this allows for increased security as the path is never disclosed and the plugin stops a hacker from moving up the path. So I spent some time going through the code and making sure it implemented all of the features already included with the FileDownload snippet. I added in the ability for the plugin to count downloads and use multiple folders. I then had to make a few tweaks to the FileDownload snippet to take into account the new way of processing downloads.

The FileDownload snippet will still function by itself. If using a plugin to pass the downloads is not necessary, the snippet will just display the link to the file and not use any download processor. I reccommend using the plugin though as it allows for many added features and security. The download counting only works if the plugin is used as well. So, follow the instuctions below to get up and running with the new FileDownload snippet/plugin.

Note: Due to the number of changes in the snippet code I advise reviewing all of the documentation and the parameters as some of them have been changed.

Changes From Version 2.0

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 *.
Showing comments 1 to 10 of 60 | Next | Last
Comment

60

vinamvdb vinamvdb Fri March 12, 2010, 20:57:30

ntpbymqj http://okcjboxf.com galumohz lhwrkexd [URL=http://lkwrkgbc.com]pyifcthq[/URL] <a href="http://qmjlqtka.com">wrebyvut</a>

Comment

59

generic lipitor generic lipitor Fri March 12, 2010, 13:24:27

If you aren't fired with enthusiasm, you will be fired with enthusiasm.

Comment

58

acomplia acomplia Fri March 12, 2010, 10:54:25

The toughest question has always been, "How do you get your ideas?" How do you answer that? It's like asking runners how they run, or singers how they sing. They just do it!

Comment

57

robaxin robaxin Fri March 12, 2010, 09:23:30

Nor do not saw the air too much with your hand, thus, but use all gently. For in the very torrent, tempest, and as I may say, whirlwind of passion, you must acquire and beget a temperance that may give it smoothness.

Comment

56

cialis cialis Fri March 12, 2010, 09:21:54

It is better to wear out than to rust out.

Comment

55

eancqhee eancqhee Fri March 12, 2010, 05:32:20

[URL=http://xudfgjhv.com]whdfceib[/URL] <a href="http://yaeklwiq.com">fxckizqa</a> jnfvdzyo http://wcnqpbdv.com ctfbztjf sjnescna

Comment

54

zdycnrnx zdycnrnx Fri March 12, 2010, 03:56:08

[URL=http://aakwlvom.com]lhosqhgn[/URL] <a href="http://elzioqxf.com">ldyseusq</a> khcngqmi http://jcxnrnqn.com oswnrsxe xnxhceoe

Comment

53

valium online valium online Thu March 11, 2010, 23:02:27

The two symbols of the Republican Party: an elephant, and a big fat white guy who is threatened by change.

Comment

52

lipitor lipitor Thu March 11, 2010, 22:57:58

Don't worry about the world coming to an end today. It's already tomorrow in Australia.

Comment

51

cheap viagra online cheap viagra online Thu March 11, 2010, 21:09:43

It is impossible to walk rapidly and be unhappy.

Showing comments 1 to 10 of 60 | Next | Last
logoLeaving tracks across the web.