# FTP 7.0 Hostname Support for net/ftp

**URL:** <https://www.ruby-forum.com/t/ftp-7-0-hostname-support-for-net-ftp/226837>\
**Category:** Ruby\
**Created:** [February 22, 2013, 7:12pm UTC](https://www.ruby-forum.com/t/ftp-7-0-hostname-support-for-net-ftp/226837 "2013-02-22T19:12:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cajuncanuck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f4b2a3/32.png) [@cajuncanuck](https://www.ruby-forum.com/u/cajuncanuck)\
**Post date:** [February 22, 2013, 7:12pm UTC](https://www.ruby-forum.com/t/ftp-7-0-hostname-support-for-net-ftp/226837/1 "2013-02-22T19:12:17Z")

</div>

I am having trouble with net/ftp connecting to a windows 2008 server  
setup with FTP 7.0 hostname support. In order to login the hostname must  
precede the username with a pipe “|” in this fashion:  
ftp://ftp.host.com|username:removed\_email\_address@domain.invalid/

I have tested the connection with other clients and it works  
successfully but when using net/ftp in ruby the connection just stalls.

Has anyone experienced this or no of a workaround?

Thanks

-Brad

require ‘net/ftp’  
URL=“[ftp.host.com](http://ftp.host.com)”  
username=“ftp.host.com|username”  
password=“password”  
directory=“/”  
ftp=Net::FTP.new  
ftp.connect(URL,21)  
ftp.login(username,password)  
ftp.chdir(directory)  
myfiles = ftp.nlst  
ftp.close  
puts myfiles.inspect

---

<div class="post-metadata">

**Author:** ![cajuncanuck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f4b2a3/32.png) [@cajuncanuck](https://www.ruby-forum.com/u/cajuncanuck)\
**Post date:** [February 22, 2013, 7:19pm UTC](https://www.ruby-forum.com/t/ftp-7-0-hostname-support-for-net-ftp/226837/2 "2013-02-22T19:19:29Z")

</div>

Subject: FTP 7.0 Hostname Support for net/ftp  
Date: sab 23 feb 13 03:12:21 +0900

Quoting Brad A. ([removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)):

> I am having trouble with net/ftp connecting to a windows 2008 server  
> setup with FTP 7.0 hostname support. In order to login the hostname must  
> precede the username with a pipe “|” in this fashion:  
> ftp://ftp.host.com|username:removed\_email\_address@domain.invalid/

Look at

ri Net::FTP::new

and notice how you are supposed to pass username & password at  
connection time.

Carlo
