Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 chanting in the Monastery: (10)
As of 2015-06-03 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What kind of chocolate gives you the most pleasure?















    Results (132 votes), past polls