Octavian Rasnita wrote:

Hi all,

I am fighting to create a simple script for downloading a file from a
server, but I cannot do it.
[snip]
1. I don't know where I can put the form fields I want to use for the post
method (r=300 ),

see 'perldoc lwpcook' -->> 'POST' section
my $req = HTTP::Request->new(POST => 'http://www.perl.com/cgi-bin/BugGlimpse');
$req->content_type('application/x-www-form-urlencoded');
$req->content('match=www&errors=0');


in your example:
my $req = HTTP::Request->new(POST => $url);
   $req->content_type('application/x-www-form-urlencoded');
   $req->content('r=300');

and I also don't know how to get the file name of the file
given by the server, in order to use that name for the downloaded file.

Filename may not even be available if the output of the server script is simply a Content-Type: header followed by content. You need to do some more investigation and/or provide more detail.






Reply via email to