#!/usr/bin/perl

use CGI qw /:standard -nosticky/;

my @fileholder;

$file_loc 	= param('file_loc');
$file_name 	= param('file_name');
$file 		= "$file_loc/$file_name";

if ($file_name eq '') { 
	print "Content-type: text/html\n\n"; 
	print "You must specify a file to download.
	\$file_loc = \"$file_loc\"
	\$file_name = \"$file_name\"
	"; 
} 
else 
{
	print header
	( 
		-type       => 'application/x-download',
	);
	open ( FILE, "<$file" ) or die "couldnt read $file";
	binmode(FILE); 
	print $_ while ( read( FILE, $_, 1024 ) );
	close FILE;
}
