M
Moulin Kluge
Hello all,
I'm using CGI.pm to upload a file to the web server, and it worked
using Redhat 7.3. I upgraded to 9, using Apache2.0.40, mod_perl 1.99,
and 3.04 of CGI.pm, and it no longer works. Here's the error log I
get:
[Tue Jan 27 16:47:34 2004] -e: Use of uninitialized value in <HANDLE>
at /var/www/cgi-bin/trakker/test.pl line 541.
[Tue Jan 27 16:47:34 2004] -e: readline() on unopened filehandle at
/var/www/cgi-bin/trakker/test.pl line 541.
The reason I think that's may be a problem with CGI.pm is because I
can remove an included module that also uses CGI.pm, and the code
works again, making me think that somehow multiple CGI objects are
interacting and invalidating the file upload handle. Here's the code,
in case I'm doing something funny that I'm not seeing:
my $uploadfile = $query->param('uploadfile');
my $filename;
if ($uploadfile =~ /([^\/\\]+)$/)
{
$filename="$1";
}
else
{
$filename="$uploadfile";
}
my $writefile = "$conf{uploaddir}/$filename";
open(OUTFILE,">$writefile")
or die "Problem writing file after upload";
binmode OUTFILE;
while (<$uploadfile>)
{
print OUTFILE $_;
}
close(OUTFILE);
Thanks for any help.
I'm using CGI.pm to upload a file to the web server, and it worked
using Redhat 7.3. I upgraded to 9, using Apache2.0.40, mod_perl 1.99,
and 3.04 of CGI.pm, and it no longer works. Here's the error log I
get:
[Tue Jan 27 16:47:34 2004] -e: Use of uninitialized value in <HANDLE>
at /var/www/cgi-bin/trakker/test.pl line 541.
[Tue Jan 27 16:47:34 2004] -e: readline() on unopened filehandle at
/var/www/cgi-bin/trakker/test.pl line 541.
The reason I think that's may be a problem with CGI.pm is because I
can remove an included module that also uses CGI.pm, and the code
works again, making me think that somehow multiple CGI objects are
interacting and invalidating the file upload handle. Here's the code,
in case I'm doing something funny that I'm not seeing:
my $uploadfile = $query->param('uploadfile');
my $filename;
if ($uploadfile =~ /([^\/\\]+)$/)
{
$filename="$1";
}
else
{
$filename="$uploadfile";
}
my $writefile = "$conf{uploaddir}/$filename";
open(OUTFILE,">$writefile")
or die "Problem writing file after upload";
binmode OUTFILE;
while (<$uploadfile>)
{
print OUTFILE $_;
}
close(OUTFILE);
Thanks for any help.