C
cardsharper
Hi
I wanted to post / upload a file to one of our https server
what i am trying to do here is trying to loging to the
https server using the user credentials . then trying to
post a file to another url which in general accepts post
after loging in .
i was able to successfully login, but unable to post
is this something todo with cookies ?
the error its throughing is "302 Found"
------------------here is the code --------------------------
#!/usr/bin/perl
use LWP;
my $url = 'https://192.168.1.3'; # Yes, HTTPS!
my $browser = LWP::UserAgent->new;
my $response = $browser->get($url);
die "Error at $url\n ", $response->status_line, "\n Aborting"
unless $response->is_success;
print "Whee, it worked! I got that ",
$response->content_type, " document!\n";
my $response1 = $browser->post( $url,
[
number => xxxxx,
password => yyyyyyy,
],
);
my $url2 = 'https://192.168.1.3/postfile';
my $response2 = $browser->post ( $url2,
[
filename =>['/tmp/abc.txt'],
],
);
die "Error at $url2\n ", $response2->status_line, "\n Aborting"
unless $response2->is_success;
I wanted to post / upload a file to one of our https server
what i am trying to do here is trying to loging to the
https server using the user credentials . then trying to
post a file to another url which in general accepts post
after loging in .
i was able to successfully login, but unable to post
is this something todo with cookies ?
the error its throughing is "302 Found"
------------------here is the code --------------------------
#!/usr/bin/perl
use LWP;
my $url = 'https://192.168.1.3'; # Yes, HTTPS!
my $browser = LWP::UserAgent->new;
my $response = $browser->get($url);
die "Error at $url\n ", $response->status_line, "\n Aborting"
unless $response->is_success;
print "Whee, it worked! I got that ",
$response->content_type, " document!\n";
my $response1 = $browser->post( $url,
[
number => xxxxx,
password => yyyyyyy,
],
);
my $url2 = 'https://192.168.1.3/postfile';
my $response2 = $browser->post ( $url2,
[
filename =>['/tmp/abc.txt'],
],
);
die "Error at $url2\n ", $response2->status_line, "\n Aborting"
unless $response2->is_success;