Upload file by http: a simple Perl CGI script

I often pity people who have to suffer the mindset common with `ms-windows' and the typical support departments who configure the computer systems for companies and even schools. The most basic activities, such as transferring files, become difficult, thanks to all the `security' that is felt necessary. Just sometimes this also becomes a trouble to me, when for example someone can only get files to me by email, but the files are too large for their server, and they're unable/forbidden to try something like ssh login to a temporary account on my computer for an upload.

The following script was made on such an evening, following bits of advice from the web about http uploading. It hasn't a tight limit on size such as some mail-servers impose. It doesn't use any authentication (although many methods may be employed to limit access, such as obscure urls, encryption and htaccess, modifications to the script, ...) so can be used in a simple way even by users who find a name/pass to be overwhelmingly much information to take on board.

upload.perl

Just download it, make it executable, make sure your webserver will run executable files as CGI, modify the file to send emails to your address (or not at all) and write uploaded files to a suitable directory, then try it out.

Some useful lines within the Apache configuration files might be:

  <Directory /home/*/public_html/cgi-bin>
     Options ExecCGI
     SetHandler cgi-script
  ...
  ScriptAlias /cgi-bin/ "/srv/http/cgi-bin/"
  ...
  <FilesMatch "\.(cgi|shtml|phtml|php)$">


Page started: 2009-06-21
Last change: 2009-06-22