Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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/fh.al 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.

Thanks

Comment on Problem in File Upload
Download Code
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 (Bishop) 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/fh.al in @INC -- which means that somewhere, your actual code is looking for fh.al 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://889794]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-07-25 21:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls