bofh_of_oz has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I am working on a few scripts to automate file transfers through FTP. So far, I used Net::FTP and everything was fine. Now, the file I am working on right now is being transferred over FTP/SSL (I believe it's the same as SFTP).
The problem is that the transfer should be in passive mode, and I do not see pasv() method in the description of Net::SFTP.

Can anyone point me in the right direction? Maybe I should use some other module to do the task? Any information is appreciated...

 

UPDATE: After being briefly exposed to a sunlight of wisdom by some esteemed monks, I realize that my case does not involve SFTP, just FTP with SSL. However, I am still unable to find the right module/method to implement the required functionality...

--------------------------------
An idea is not responsible for the people who believe in it...

  • Comment on File transfer over SFTP - Passive mode?

Replies are listed 'Best First'.
Re: File transfer over SFTP - Passive mode?
by merlyn (Sage) on May 12, 2005 at 16:34 UTC
    Nope. FTP over SSL is that. SFTP uses the SSH protocols, and "passive mode" wouldn't make sense, since there's ever only one major connection between client and server. (Data streams are handled as sub-connections, not parallel connections.)

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Thanks a lot for clarifying that for me :) Is there a Perl module I can/should use for secure (SSL) FTP transfers?

      --------------------------------
      An idea is not responsible for the people who believe in it...

Re: File transfer over SFTP - Passive mode?
by idsfa (Vicar) on May 12, 2005 at 17:55 UTC

    cURL supports ftp-sand has perl bindings. Something like:

    use strict; use WWW::Curl::easy; my $url = "ftps://username\@ftps.server/path/"; # Init the curl session my $curl= WWW::Curl::easy->new() or die "curl init failed!\n";

    Plus the ftp test that comes with the module should put you on the right track.

    Oh, and PASV is the default mode for ftps ...


    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. -- Cyrus H. Gordon
Re: File transfer over SFTP - Passive mode?
by salva (Canon) on May 12, 2005 at 16:38 UTC
    SFTP is not FTP over SSL but a completelly different protocol, designed to be used over ssh connections.
Re: File transfer over SFTP - Passive mode?
by etm117 (Pilgrim) on May 12, 2005 at 17:21 UTC
    Update: Removed my response when I saw the update from the author that he was dealing with FTP over SSL, not SFTP.
      I think it's good to leave your answers even if the OP updates h(er|is) post: (s)he clearly states that it's an update, so your post continues to make sense. OTOH, leaving messages is less worrying for you and added value for the community: people who's not fluent in English can read the same thing explained by two different persons (repetita iuvant, i.e. repetitions help). This can apply to English-fluent people in some cases too :)

      Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

      Don't fool yourself.