Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Unable to complete download with Net::FTP

by holo (Monk)
on Nov 28, 2003 at 22:00 UTC ( #310791=note: print w/replies, xml ) Need Help??


in reply to Unable to complete download with Net::FTP

I would check the return code of each $ftp->... call just in case something wrong is happening:

use strict; use warnings 'all'; use Net::FTP; my $host = 'ftp.ncbi.nih.gov'; my $ftp = Net::FTP->new($host, Debug=>0) or die "Cannot connect to $host ", $ftp->message; $ftp->login('anonymous', 'anon@anon.com') or die "Cannot login ", $ftp->message; $ftp->cwd('/refseq/LocusLink/') or die "Cannot cwd ", $ftp->message; $ftp->type('binary') or die "BINARY failed ", $ftp->message; $ftp->get('LL_tmpl.gz') or die "Cannot get file ", $ftp->message; $ftp->quit; # well ... almost every call ;)

Take a look at the Net::FTP docs.

Replies are listed 'Best First'.
Re: Re: Unable to complete download with Net::FTP
by Itatsumaki (Friar) on Nov 28, 2003 at 22:11 UTC

    Ahh, good catch. It fails the $ftp->type() line, which is probably the source of my problem. I was able to fix it by using $ftp->binary() instead of $ftp->type(). Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://310791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2020-07-16 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?