It is possible, although I know _no_ Perl whatsoever.
Take a look at this script I found:
Code:
Code from File Download Script blahblahblah...
#!/usr/bin/perl -wT
use CGI ':standard';
use CGI::Carp qw(fatalsToBrowser);
my $files_location;
my $ID;
my @fileholder;
$files_location = "/usr50/home/webdata/photos";
$ID = param('ID');
if ($ID eq '') {
print "Content-type: text/html\n\n";
print "You must specify a file to download.";
} else {
open(DLFILE, "<$files_location/$ID") || Error('open', 'file');
@fileholder = <DLFILE>;
close (DLFILE) || Error ('close', 'file');
open (LOG, ">>/usr50/home/webdata/public_html/test.log") || Error('open', 'file');
print LOG "$ID\n";
close (LOG);
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$ID\n\n";
print @fileholder
}
Ok, it does much more than what you want to do, but I think that if you take a better look at it you may be able to understand some parts (ie. the bits you need).
I _think_ that you'd need to put in something like the following:
Code:
#Declare a variable
my @fileholder;
#Download the file
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$ID\n\n";
print @fileholder
Please note that I don't have the foggiest idea if that'll work or not, I just didn't want to leave this thread unanswered.
M.