I have written the following script to let people download files from a web
browser without displaying the actual location, utilising a MySQL database.
It works ok, except that it renames the file download.cgi (the name of my
script). How can I make it keep the proper name?
<script posted here>
#!/usr/bin/perl
use CGI qw/:standard/;
use CGI::Carp "fatalsToBrowser";
use DBI;
#####Get Input
$filenum = param('file');
#####Get Database Data
$dbh = new CGI;
$dbh=DBI->connect("DBI:mysql:database=misc;host=127.0.0.1;port=3306",downloads,downloads);
die "Could not connect to database" if !$dbh;
$sth = $dbh->prepare("SELECT location FROM downloads WHERE filenum =
'$filenum'");
if ($sth && $sth->execute()){
@results = $sth->fetchrow_array();
}
$location = $results[0];
#####Redirect to File
print "Location: $location\n\n";
exit;
</script posted here>
--
Matthew Harrison
Internet/Network Services Administrator
Peanut-Butter Cheesecake Hosting Services
Genstate
www.peanutbuttercheesecake.co.uk
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]