Advertisement
blogfakessh

Untitled

Jul 21st, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #! /usr/bin/perl
  2. use LWP;
  3. use HTTP::Request::Common;
  4.  
  5. my ($url, $file) = @ARGV;
  6. my $ua = LWP::UserAgent->new();
  7. my $req = POST $url,
  8. Content_Type => 'form-data',
  9. Content => [
  10.  
  11. ##rediger en fonction du formulaire
  12. Filedata => [ "$file", "file.gif", Content_Type =>
  13. 'image/gif' ],
  14. folder => "/uploadify/"
  15. ];
  16. my $res = $ua->request( $req );
  17. if( $res->is_success ) {
  18. print $res->content;
  19. } else {
  20. print $res->status_line, "\n";
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement