Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Problem in File Upload

by Anonymous Monk
on Feb 23, 2011 at 14:04 UTC ( #889794=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl Monks,

I am trying to upload files using below Perl script, but I am getting error as
Can't locate auto/APR/Request/Param/ in @INC (@INC contains: .....

my $upload = $r->upload("filename"); my $fh; open FHANDLE, ">$filepath"; $fh = $upload->fh(); binmode FHANDLE; print FHANDLE <$fh>; close FHANDLE;

What's wrong in this code? How can I resolve this issue, Please provide me solution.


Replies are listed 'Best First'.
Re: Problem in File Upload
by moritz (Cardinal) on Feb 23, 2011 at 14:10 UTC
    It is highly unlikely that the code you've shown us triggers that error.

    It is likely that a not properly installed APR::Request::Param causes that error.

    Still there's something wrong with the code you've shown us too: it open a file without checking if it succeeded. That is only acceptable if autodie is in scope.

Re: Problem in File Upload
by ww (Archbishop) on Feb 23, 2011 at 14:12 UTC
    "using below Perl script,...."

    Not a script; a fragment and not one from which I can deduce what you're doing... despite the (semi-) self-explanatory message, Can't locate auto/APR/Request/Param/ in @INC -- which means that somewhere, your actual code is looking for other than where it actually exists (if, indeed, it does on your machine).

    You're going to need to give me (and possibly, better informed Monks, as well) more information.

Re: Problem in File Upload
by Anonymous Monk on Jan 28, 2013 at 16:45 UTC
    For the record this can be caused by not including "use Apache2::Upload;" in the package in question. It's an extra step you need when using Apache 2.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://889794]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2017-11-24 15:12 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (349 votes). Check out past polls.