Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: POST'ing a large File with LWP::UserAgent

by Anonymous Monk
on Nov 30, 2011 at 06:34 UTC ( #940782=note: print w/ replies, xml ) Need Help??


in reply to Re^2: POST'ing a large File with LWP::UserAgent
in thread POST'ing a large File with LWP::UserAgent

Thanks for the feed back. Hi can you explain what the below code actually do

# set up callback { my $gen = $req->content(); die unless ref($gen) eq "CODE"; my $i = 0; $req->content( sub { my $chunk = &$gen(); # get chunk of data warn $i++; return $chunk; # send it to $url } );


Comment on Re^3: POST'ing a large File with LWP::UserAgent
Download Code
Re^4: POST'ing a large File with LWP::UserAgent
by Anonymous Monk on Nov 30, 2011 at 08:32 UTC

    Thanks for the feed back. Hi can you explain what the below code actually do

    Hi. There is no way you were overrider ;)

    The code saves the default (DYNAMIC_FILE_UPLOAD) callback for uploading a large file, and wraps it in another callback, which invokes the original callback, but also counts the number of times it was called, and reports the number stderr

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2014-09-21 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls