#!/usr/bin/perl -wT  
  
use CGI ':standard';  
use CGI::Carp qw(fatalsToBrowser);   
  
my $files_location;   
my $ID;   
my @fileholder;  
  
$files_location = "/var/www/vhosts/arabdemog.com/httpdocs/cf/images";  
  
$ID = param('ID');  
  
if ($ID eq '') {   
print "Content-type: text/html\n\n";   
print "You must specify a file to download.";   
} else {  
  

  
open (LOG, ">$files_location/link.log") || Error('open', 'file');  
print LOG "TEst\n" or die "Could not Write"; 
close (LOG);

open(DLFILE, "<$files_location/link.log") || Error('open', 'file');   
@fileholder = <DLFILE>;   
close (DLFILE) || Error ('close', 'file');  

#print "Content-Type:application/x-download\n";  
print "Content-Type:application/x-download\n";  
print "Content-Disposition:attachment;filename=$files_location/link.log\n\n";  
print @fileholder  
}