Better Living Through Thinking

Yet another download script

Sat, 26 Aug 2006

Here is a very simple download script; it has three configurable variables near the top of the file (self-explanitory).

The program (serve.cgi) serves files out of a specified directory; this directory should not otherwise be accessible by the web server (e.g., under a document root somewhere).

Access to the script should be controlled by some kind of web server-based authentication and authorization (e.g., basic auth or session-based auth).

You might link to files like this, for the authenticated user:

<a href="/cgi-bin/serve.cgi?f=somefile.pdf">somefile.pdf</a>

You may also specify files in a hierarchy:

<a href="/cgi-bin/serve.cgi?f=subdir/otherfile.jpg">otherfile.jpg</a>

Requirements: Perl 5.8 or higher

The program:

<serve.cgi>

Version: 0.11 (updated: Sat Aug 26 21:44:27 MDT 2006)

[ category: /perl | link: download_script ]

Audio Broadcast

(standby)

Moon Status

Phase: 99.97%
Illuminated: 0.00%
Age (days): 29.52
moon phase 0.999684503061995 Sun May 20 17:34:08 MDT 2012