Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013449]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2016-12-07 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (131 votes). Check out past polls.