> This should be a simple little script. > > But it errors out every time. > > Query: > test.cgi?fname=&lname=&file=C%3A%5CDocuments+and+Settings%5Cpd > k%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 ) ) {
either $fh is not being set or your constant is goofy (16_384? Do you mean 16384 ?) Trying printing them instead of your while statement to see if they actually have data and you should get some kind of output. print "my fh is -$fh-"; If it says My fh is -- the $fh is not being set and the troubleis whith $cgi->upload() somehow, could you check for errors with uplaod()? Like my $fh = $cgi->upload($file) or die "Content-type: text/html\n\n no uploadicus $!"; HTH DMuey > 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] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]