# File lib/installer.rb, line 110
  def install_ftp
    puts "Installing owncloud to remote web server via FTP..."

    assert_options [ :server, :ftp_user, :ftp_password ]

    ftp = Net::FTP.new( server )
    ftp.passive = true
    puts "  Logging in..."
    ftp.login ftp_user, ftp_password

    puts "  Finding installation directory..."
    install_dir = ""
    [ "httpdocs" ].each do |d|
      dir = try_ftp_cd ftp, d
      if dir
        install_dir = dir
        break
      end
    end
    print "  Installing to dir '#{install_dir}'..."

    upload_dir_ftp ftp, @source_dir, "owncloud"
    puts ""
    
    puts "  Closing..."
    ftp.close
  end