use constant BUFFER_SIZE => 4096; my $file_directory = '/home/goldcal/www/files/'; my $buffer = ""; my $file = $file_directory . '/wlmlm401.exe'; print $cgi->header( -type => "application/exe", -expires => "-1d" ); #local *FILE; open (FILE, "<$file") or die "Cannot open file $file: $!"; binmode ( STDOUT ); binmode ( MY_FILE ); while( read( MY_FILE, $buffer, BUFFER_SIZE ) ) { print $buffer; } close FILE;