Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: lwp post file

by negrotelmonk (Initiate)
on Jan 15, 2013 at 19:40 UTC ( #1013449=note: print w/ replies, xml ) Need Help??


in reply to lwp post file

here is the correct code for ajax img upload

my $browser = LWP::UserAgent->new; $picture = 'fun.jpg'; $browser->default_header('X-Requested-With' => "XMLHttpRequest"); $browser->default_header('X-File-Name' => $picture); my $value = read_file( $picture, binmode => ':raw', scalar_ref => 0); my $response = $self->browser->post( "http://host.com/upload/profilepi +c/?qqfile=".$picture, Content_Type => 'application/octet-stream', Content => $value ); print $response->content;


Comment on Re: lwp post file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-12-27 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls