Method: FileTransfer::Ftp#download

Defined in:
lib/file_transfer/ftp.rb

#download(from_path, to_path) ⇒ String

Downloads data from FTP server

Parameters:

  • from_path (String)

    remote path

  • to_path (String)

    locale path

Returns:

  • (String)

    remote path of downloaded file



46
47
48
49
50
51
52
53
# File 'lib/file_transfer/ftp.rb', line 46

def download(from_path, to_path)
  from_path = split_path(from_path)
  open_connection do
    ftp.chdir from_path[:file_path]
    ftp.getbinaryfile(to_path, from_path[:file_name])
    "#{from_path[:file_path]}/#{from_path[:file_name]}"
  end
end