On Mon, 1 Nov 1999, Tubbs, Derric L wrote:
> Well, I finally got it to work with Apache::Request. I had to do "$args =
> Apache::Request->new($r);" and "$file = $args->upload;" in the handler sub
> and then pass $args and $file to any other subs that needed it. Maybe this
> is normal but if so I was unaware of it. I was doing all of the above
> within a different sub that gets called from handler.
>
> BTW, Can I do a conditional on the creation of $file that would return false
> if there was no file uploaded???
just test for ->filename:
if (my $upload = $apr->upload) {
my $filename = $upload->filename;
unless ($filename) {
print "no file specified";
return;
}
...