in reply to How could i FTP specific file from remote system ?
Check the response from the ls command when you debug; for some hosts you may need to rework the ls output to get it into the right format.use Net::FTP; $ftp = Net::FTP->new($host, Debug => 0) or die "Cannot connect to $host $@"; $ftp->login($user_name,$password) or die "Cannot login ", $ftp->message; $ftp->cwd($target_dir) or die "Cannot cd to $target_dir", $ftp->message; my @files = $ftp->ls('nok*'); for (@files) { $ftp->get($_) or die "couldn't get $_", $ftp->message; ... do something with the file ... } $ftp->quit;
|
|---|