Edu Edu - 5 months ago 34
Perl Question

How to set the transfer mode to ASCII in SFTP (version 3) using Perl

I have a requirement to transfer the files using SFTP (version 3) in Perl. While transferring the files, I need to set the transfer mode to ASCII.

Can some one please confirm, it if is possible using any of the Perl modules (

Net::SFTP
/
Net::SFTP::Foreign
/any)?

Answer

Using Net::SFTP::Foreign:

$sftp->put($local_from, $remote_to, conversion => 'unix2dos');

See On the fly data conversion.

Comments