note
gube
<p>Thanks almet for ftp idea. Same, I got inputs from the node <a href="http://www.perlmonks.org/?node_id=539261">http://www.perlmonks.org/?node_id=539261</a> for SFTP. I got the files what i need from the directory using $sftp->ls.</p>
<code>
my %args = (user => encode("iso-8859-1", $ftp_user) , password => encode("iso-8859-1", $ftp_passwd));
$args{ssh_args} = [ port => encode("iso-8859-1", $ftp_port) ] if $ftp_port;
$sftp = Net::SFTP->new($ftp_url, %args);
return 0 if (!$sftp);
$sftp->ls($ftp_additional_path, sub { my $ref = shift;
if ($ref->{'filename'} =~ /_3rdParty_/) {
$files->{$ref->{'filename'}} = 1
}
});
print (keys %{$files});
$sftp->get(encode("iso-8859-1", $ftp_file), $local_file);
my ($statuscode, $statustext) = $sftp->status;
$log->error("\nFile not found") if($statustext ne "No error");
</code>
814638
814638