Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
here is what I have so far:http://host.com/upload/profilepic/?qqfile=fun.jpg Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip,deflate Connection: keep-alive X-Requested-With: XMLHttpRequest X-File-Name: fun.jpg Content-Type: application/octet-stream Content-Length: 63970 Pragma: no-cache Cache-Control: no-cache ############ raw image ###########
I can not send the image as raw data. Please helpmy $browser = LWP::UserAgent->new; $picture = 'fun.jpg'; $browser->default_header('X-Requested-With' => "XMLHttpRequest"); $browser->default_header('X-File-Name' => $picture); my %args; my $field_name = ""; my $buf ; my $buf_ref = $args{'buf'} || \$buf ; my $value = read_file( $picture , binmode => ':raw' , scalar_ref => 1 +); my $response = $self->browser->post( "http://host.com/upload/profilepi +c/?qqfile=".$picture, Content_Type => 'application/octet-stream', Content => $value ); print $response->content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: lwp post file
by roboticus (Chancellor) on Dec 23, 2012 at 13:29 UTC | |
by Anonymous Monk on Dec 23, 2012 at 14:39 UTC | |
by roboticus (Chancellor) on Dec 23, 2012 at 14:48 UTC | |
|
Re: lwp post file
by negrotelmonk (Initiate) on Jan 15, 2013 at 19:40 UTC |