hi there, i am trying to add a function to an IRC bot I am developing that allows me to upload graphs to an imagehost called
picboost.com. It uses POST to allow you to upload pictures.
this is what i have so far:
Code:
use LWP::UserAgent;
use File::Slurp;
use warnings;
use strict;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
my $url = "http://www.picboost.com/upload";
my $picture = "/home/snak3/graph.png";
my %args;
my $field_name = "userfile";
my $buf ;
my $buf_ref = $args{'buf'} || \$buf ;
my $value = read_file( $picture , binmode => ':raw' , scalar_ref => 1 );
my $response = $ua->post( $url, $field_name => $value);
print $response->content;
when i do this, all i get is the HTML page saying that i didn't select anything to upload... what am i doing wrong?
thanks in advance,
s0l1dsnak3123
ps. I am not fussed with what modules are used to upload the file. If I am using the wrong ones, or if you have more experience with a different module that can achieve the same task, no problem