my $req = new CGI; my $file = $req->param("FILE$onnum"); if ($file ne "") { my $fileName = $file; $fileName =~ s!^.*(\\|\/)!!; $newmain = $fileName; if ($allowall ne "yes") { if (lc(substr($newmain,length($newmain) - 4,4)) ne $theext) { $filenotgood = "yes"; } } if ($filenotgood ne "yes") { open (OUTFILE, ">$basedir/$fileName"); print "$basedir/$fileName
"; while (my $bytesread = read($file, my $buffer, 1024)) { print OUTFILE $buffer; } close (OUTFILE); } }