Net::FTPFXP RubyGem

The purpose of this project is to extend the standard Net::FTP module by providing Server-to-Server file transfer and SSL/TLS secure control and data connection capabilities. SSL/TLS support for file transfer using SSCN and CPSV are both supported.


Table of Contents

  1. Project Information
  2. Features
  3. Installation
  4. Sample Usage of SSCN FXP
  5. Sample Usage of CPSV FXP

Project Information


Features


Installation

gem install ftpfxp

Sample Usage of SSCN FXP

#!/usr/bin/env ruby
require 'rubygems'
require_gem 'ftpfxp'

class TestClass
  def initialize
    @conn1 = Net::FTPFXPTLS.new
    @conn1.passive = true
    @conn1.debug_mode = true
    @conn1.connect('192.168.0.1', 21)
    @conn1.login('myuser1', 'mypass1')

    @conn2 = Net::FTPFXPTLS.new
    @conn2.passive = true
    @conn2.debug_mode = true
    @conn2.connect('192.168.0.2', 21)
    @conn2.login('myuser2', 'mypass2')
  end

  def fxp
    @conn1.fxpsscnto(@conn2, '/dstpath/myfile.tar.bz2', '/srcpath/myfile.tar.bz2')
  end

  def close
    @conn1.close
    @conn2.close
  end
end

testrun = TestClass.new
testrun.fxp
testrun.close

Sample Usage of CPSV FXP

#!/usr/bin/env ruby
require 'rubygems'
require_gem 'ftpfxp'

class TestClass
  def initialize
    @conn1 = Net::FTPFXPTLS.new
    @conn1.passive = true
    @conn1.debug_mode = true
    @conn1.connect('192.168.0.1', 21)
    @conn1.login('myuser1', 'mypass1')

    @conn2 = Net::FTPFXPTLS.new
    @conn2.passive = true
    @conn2.debug_mode = true
    @conn2.connect('192.168.0.2', 21)
    @conn2.login('myuser2', 'mypass2')
  end

  def fxp
    @conn1.fxpto(@conn2, '/dstpath/myfile.tar.bz2', '/srcpath/myfile.tar.bz2')
  end

  def close
    @conn1.close
    @conn2.close
  end
end

testrun = TestClass.new
testrun.fxp
testrun.close

Using Google Sitemaps Valid XHTML 1.1 Valid CSS