You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Issac Goldstand <ma...@beamartyr.net> on 2001/10/13 18:33:40 UTC

libapreq returning very strange error

I recently tried to use some of what I've tried to learn about the UPLOAD_HOOK provided via Apache::Request.  However, when using it, I get a really weird error:
  Undefined subroutine &Apache::Upload::handler called at /dev/null line 1.

Anyone know what would be causing this error (and, by the way, where the reference to /dev/null is coming from)?

Here's the function that provides the hook:

    my $r=shift;
    ### Upload hook handler
    
    my $hook_handler= sub {
        my ($upload, $buf, $len, $hook_data)=@_;
        $hook_cache->set($hook_data,$len);
        Apache->log_error("$hook_data: got $len bytes for ".$upload->name);
    };
    
    my %cookies=Apache::Cookie->fetch;
    return BAD_REQUEST unless defined($cookies{u_id});
    my $u_id=$cookies{u_id}->value;
    my $q=Apache::Request->new($r, HOOK_DATA=>$u_id, UPLOAD_HOOK=>$hook_handler, TEMP_DIR=>"/home/www/spool");
    return OK;

The TEMP_DIR is there because the file will be saved to /home/www/files and /home/www is the mount point for the HD partition.

Thanks,
  Issac


Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
  --Anonymous

Moving the mouse won't get you into trouble...  Clicking it might.
  --Anonymous

PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B