Mike Melillo wrote:

> I am trying to have a user upload an image and I am getting an undef
> $apr->upload object.
> 


[snip]



> sub upload {
> 
>         my ($r) = shift;
>         my $apr = Apache::Request->new($r);
>         my $status = $apr->parse;


you might want to check the status of that upload here first

   return $status unless $status == OK;

and look into

   $apr->notes("error-notes");

if it fails.


>         my $upload = $apr->upload; 
>         print STDERR Dumper($upload);
>         my $size = $upload->size;
>         if ($size > 30000) {


you can handle that condition with the POST_MAX parameter in new().


other than that, nothing jumps out at me.

we have a working example that may be able to help you some:

   http://www.modperlcookbook.org/code/ch03/Cookbook/PrintUploads.pm

HTH

--Geoff

Reply via email to