ftp - using retr from perl script - 'RETR' not understood -
i have simple task, in company need download files ftp server, normaly i've got scripts , can handle this, on 1 server have problems. when use system specific ftp command works fine file can downloaded, when try perl error "'retr' not understood".
my scripts looks this
shell:
ftp> debug
perl script:
ftp> open xx.xx.xx.xx
220 proftpd 1.3.0 server (proftpd default installation) [xx.xx.xx.xx]
ftp> cd in
---> cwd in
250 cwd command successful
ftp> somefile10112499xxx.zip
---> port 3,126,181,35,14,131
200 port command successful
---> retr somefile10112499xxx.zip
150 opening ascii mode data connection somefile10112499xxx.zip (13299 bytes)
226 transfer complete.
ftp: 64d bajtów odebranych w 0,01sekund 889,80kbajtów/sek.
ftp> quit
---> quit
221 goodbye.
use net::ftp;
try passive mode, ascii , binary transmission method, of make "net::ftp=glob(0x1ee71a0)<<< 500 'retr' not understood".
$ftp = net::ftp->new($ftp_host, debug => 1,passive=>0) ;
$ftp->login($ftp_user,$ftp_pass) ;
$ftp->retr("somefile10112499xxx.zip");
$ftp->quit;
are there others parameters define default in command ftp? maybe should make changes in perl script?
is there reason you're using $ftp->retr()
instead of $ftp->get()
downloading these files? net::ftp if you're downloading files use
get ( remote_file [, local_file [, where]] )
method. believe retr()
method returns reference net::ftp::dataconn
object.
Comments
Post a Comment