| Apache2-OneTimeDownload documentation | view source | Contained in the Apache2-OneTimeDownload distribution. |
Apache2::OneTimeDownload - Tolerant mechanism for expiring downloads
Allows you to distribute files that expire a given time after the first download
In your Apache config:
PerlModule Apache2::OneTimeDownload <Location /download> PerlHandler Apache2::OneTimeDownload SetHandler perl-script PerlSetVar OneTimeDb /home/sheriff/download_access.db PerlSetVar OneTimeWindow 3600 PerlSetVar OneTimeDownloadDirectory /home/sheriff/downloads/ </Location>
Example authorize.pl...
#!/usr/bin/perl use Apache2::OneTimeDownload; my $file = $ARGV[0]; my $comment = $ARGV[1-]; my $db = '/opt/secret/access.db' print Apache2::OneTimeDownload::authorize( $db, $comment, $file );
and then:
% authorize.pl TopSecret.pdf Given out on IRC... 2c61de78edd612cf79c0d73a3c7c94fb
Which might mean:
http://www.sheriff.com/download/2c61de78edd612cf79c0d73a3c7c94fb
The location of the DB file where key->file mappings will be kept
The amount of time after a download you wish the file to remain before it expires. An hour is a good sized window...
The directory from which you're serving your file downloads - probably not one that's accessible from the web...
Absolute path of the database
Plain text comments about the file
Location of the file - this has the download directory stuck at the beginning of it when it comes to download time...
Time in seconds until the file expires before anyone has downloaded it. Defaults to a week.
Stephan Jauernick -- stephan@stejau.de
Pete Sergeant -- onetimedownload@clueball.com
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Apache2-OneTimeDownload documentation | view source | Contained in the Apache2-OneTimeDownload distribution. |