This should be a simple little script. 

But it errors out every time.

Query:
test.cgi?fname=&lname=&file=C%3A%5CDocuments+and+Settings%5Cpdk%5CDeskto
p%5Cascii-full.gif

Scrpit
------
#!/usr/bin/perl -wT

use strict;
use warnings;
use CGI;
use constant BUFFER_SIZE => 16_384;
my $cgi = new CGI;
my $buffer = "";
my $file = $cgi -> param  ( 'file' );
my $fh   = $cgi -> upload ( $file  );
open ( OUT , ">incomingfile" ) || die ( "Could not open output file");

while ( read ( $fh, $buffer, BUFFER_SIZE ) ) {
  print OUT $buffer;
}
close OUT;



print $cgi -> header( "text/html" );
print $cgi -> p ( "$fh $file $buffer " . BUFFER_SIZE );


Error log
---------
Can't use an undefined value as a symbol reference at
/srv/www/cgi-bin/test.cgi line 13.
[Tue Sep  9 11:05:17 2003] [error] [client xxx.xxx.xxx.xxx] Premature
end of script headers: /srv/www/cgi-bin/test.cgi


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to