Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 meditating upon the Monastery: (5)
As of 2014-10-22 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls