HTTP::DownloadLimit - module to set restrictions for files downloading from your webserver
This document describes HTTP::DownloadLimit version 0.1.0
use HTTP::DownloadLimit; my $obj = HTTP::DownloadLimit->new ( REMOVE_FILE => 1, TYPE_ALLOW => [qw/mp3 avi jpg/], FILE_NAME => $ENV{'PATH_INFO'}, DEBUG => 1 ); $obj->Download;
This module allows you to log all downloads, restrict downloadable files extensions and concurrent downloads of the same file.
Note: there are a bunch of private module which are not discribed here. Constructor new(ARGS) Creates a new instance. Takes arguments as key => value pairs. Required arguments are: FILE_NAME - default value is taken from $ENV{'PATH_INFO'}. Download link will look like this: http://host/cgi-bin/HttpDownloadsControl.pl/Films/fileName.avi Optional arguments are: REMOVE_FILE - Delete file's parent directory after processing finished. Default: 1 TYPE_ALLOW - Downloadable file extensions. Default: avi, mov, mpeg, mkv, mp4, mpg, vob BUFFER - read()'s function buffer size in bytes. Default: 262144 DEBUG - Enable logging. Default: 1 MULTI - Allow concurrent download of the file. Default: 0 PATH - Path to files storage dir. Default: '.' LOG - Path to log file. Default: /var/log/HTTP::DownloadLimit.log Main methods: Download - No arguments needed. Return http status code or requested file content.
If you find the bug, please report it.
n4n0bit <n4n[dot]lab[at]gmail[dot]com>
(c) 2008 by n4n0bit <n4n[dot]lab[at]gmail[dot]com> This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself
To install HTTP::DownloadLimit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::DownloadLimit
CPAN shell
perl -MCPAN -e shell install HTTP::DownloadLimit
For more information on module installation, please visit the detailed CPAN module installation guide.