Thank you. I will try your example and check the lwpcook.

The file name is available, and I guess the server sets the appropriate
header for doing that and I will try to verify it.

Teddy

----- Original Message ----- 
From: "Doug Monroe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 11, 2004 3:56 PM
Subject: Re: Using the post method for downloading a file


> 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