in reply to Re: Download file from sftp or FTP
in thread Download file from sftp or FTP

And now...
use Net::SFTP::Foreign; # BTW, setting your locale correctly would probably # make these "encode" operations unnecessary! my %args = (user => encode("iso-8859-1", $ftp_user), password => encode("iso-8859-1", $ftp_passwd), fs_encoding => "iso-8591-1"); $args{port} = encode("iso-8859-1", $ftp_port) if defined $ftp_port; $sftp = Net::SFTP::Foreign->new($ftp_url); $sftp->error and die "unable to connect ro remote host: " . $sftp->err +or; $sftp->mget($ftp_file, $local, on_error => sub { warn "error: " . $_[0]->error });