Getter is a secure, single-file, PHP-powered download manager and logging script. Getter gives your clients the ability to download files without revealing the actual name or directory structure of your server. Built-in hotlink protection also prevents bandwidth leeching from other websites.
Download the latest version of Getter, and copy download.php
to the directory where you normally serve your downloads.
All editable options are contained in the Configuration class:
BASE_DIRECTORY
- Set the directory that all downloadable files will be stored inHOTLINK_PROTECTION
- Flag to set hotlink protectionHOTLINK_PROTECTION_ALLOW_NULL
- Flag to allow NULL HTTP Referrers when Hotlink Protection is activeHOTLINK_REDIRECT_URL
- The redirect destination when hotlinking is detectedLOG_DOWNLOADS
- Flag to set logging of downloadsLOG_FILENAME
- The filename of the download logDASHBOARD_ON
- Flag to turn the Web Panel onDASHBOARD_TOKEN
- The URI token used to reach the Web PanelDASHBOARD_ITEMS_MAX_NUM
- Maximum number of most recent log entries listed on the Web PanelDASHBOARD_USERNAME
- HTTP Auth username for the Web PanelDASHBOARD_PASSWORD
- HTTP Auth password for the Web Panel$MIME_TYPES
- Array of MIME types, used when serving files$HOTLINK_WHITELIST
- Array of allowed Referrers for downloads
There are 3 ways to download a file using Getter:
download.php?[FILENAME]
download.php?[FILENAME]/[ALIAS]
download.php?[FILENAME_HASH]/[ALIAS]
Given a filename, Getter will perform a depth-first search through the BASE_DIRECTORY
. The [FILENAME]
should be unique for all files stored in the base directory, even if those two files are not in the same folder/sub-folder. When two files share the same name, Getter will transfer the first file of that name it encounters, which may not be the desired result.
When [ALIAS]
is provided, the user will be prompted to save the file using the alias instead of the actual filename.
The [FILENAME_HASH]
is an MD5 hash of the [FILENAME]
you wish to download. This prevents the use from knowing the actual name of the file you are serving. When using filename hashes, you must provide an alias, otherwise Getter will throw a 404 Not Found error.
When HOTLINK_PROTECTION
is set to true, Getter will only serve request given from domains in the $HOTLINK_WHITELIST
. When an unauthorized request is made, the user will be redirected to the url set in HOTLINK_REDIRECT_URL
. If it is null, the user will be presented with a 403 Forbidden error.
Simply adding mydomain.com
to the whitelist will not give access to any subdomain (eg. sub.mydomain.com
, or even www.mydomain.com
). Each specific domain URL must be included in the whitelist. To give broad access to a domain, use the wildcard *
(eg. *mydomain.com
).
Getter relies on the HTTP Referer information given by the client to provide hotlink protection. This is imperfect, as HTTP Referer information can be spoofed and there are many cases in which the client does not give any information. When HOTLINK_PROTECTION_ALLOW_NULL
is set to true, Getter will serve downloads to null referrers when hotlink protection is active. Setting this to false will produce a much more strict behavior.
When LOG_DOWNLOADS
is set to true, Getter will log every download that it handles on the server into a single CSV. This file is generated in the same directory that Getter resides in. It will collect a date-timestamp, the client's IP Address, the Request URL, and the file that was requested.
When DASHBOARD_ON
is set to true, you can manage the log using Getter's built-in web panel. Use the DASHBOARD_TOKEN
token as part of the URL to access this. The default token is admin, and the default URL is:
http://www.yourdomain.com/download.php?admin
Warning: Clearing the log deletes the logged data off the server, not just the page. You cannot recover your log data after you've cleared it.
The logs generated by Getter are plain text ASCII CSV files. These logs can be viewed raw by any ASCII editor or Word Processor like Notepad, Wordpad, and Microsoft Word. The file should can easily be imported into spreadsheet applications like Excel.
Copyright © 2007-2015 Gowon Designs Ltd. Co.
This program is distributed under the terms of the GNU General Public License Version 3.