Hi Greg

What says the error message?

if ($response->is_error()) {
          print "error msg: $response->status_line";
} 

cheers, Simon


> I am new and inexperienced and can't find a way to get past something that
> is probably pretty simple.  So here is my problem:
> I have always used the following script to download files:
>           $user_agent=new LWP::UserAgent;
>           $user_agent->timeout([$secs]);
>           $request=new HTTP::Request("GET","${urlfilename}");
>           $request->authorization_basic("${username}","${password}");
>           $response=$user_agent->request($request);
> 
>           if ($response->is_success)
>           {
>           open (DOWNLDFILE, ">${datadir}/$filename") || die ("Cannot open
> date file ${datadir}/$filename: $!");
>           print DOWNLDFILE $response->{_content};
>           close DOWNLDFILE;
>           }
> 
> The script is not working for the url I am now trying to access.  I have
> taken the urlfilename to the internet browser to see if the url address is
> the problem.  The urlfilename returns the Microsoft File Download menu
> asking me whether I want to open the file to the current location or save
> to a disk.  I'm thinking that this may be what is blocking my download.  Am
> I right?  If so, how do I get around this?
> 
> (Sorry about the simple question.  I can tell by reading the messages on
> this listserv that most of you are lightyears ahead of me.  I have been
> reading as much as I can on the cpan web site.  If you point me in the
> right direction and give me a kick I'd appreciate it.)
> Thanks,
> Greg
> 
> 
> 


Reply via email to