6

I have set up a number of an FTP sites using IIS7.5. The sites use hostnames to differentiate between them. One drawback of using hostnames is that you have to pass the address of the ftp site into the username e.g.

Ftp Address: ftp://ftp.example.com

Username: ftp.example.com|User1

Password: psswrd

I would like to at least pass in the username as part of the connection address e.g. ftp://ftp.example.com|[email protected] but I have been unable to do this using Windows Explorer (in Windows 7). Whenever I try this technique I'm still prompted to enter the user name and password.

I have set the useDomainNameAsHostName=True on the server which allows a bit more flexibility in the username but I still can’t get it to work. Neither ftp://ftp.example.com%[email protected]/ or ftp://User1%[email protected]/ seems to make any difference in IE9 or Chrome.

Where am I going wrong?

2
  • Is there a reason why you can't simply use: ftp://username:[email protected] ?
    – iglvzx
    Commented Dec 3, 2011 at 0:23
  • Yeah, it isn't working, hence my question. I'm using windows 7 and a collecting to ftp via windows explorer. Passing the username in the format you suggested just prompts me with a login dialog which doesn't have the user name populated. My main goal is to be able to pass around a connection string so that all the client has to do is enter the password. Commented Dec 5, 2011 at 11:43

4 Answers 4

5
+50

Working with IIS 7.5 is a bit daunting when it comes to the new virtual hostnames for FTP servers. However, even though it seems you have configured yoru IIS 7.5 server correctly, IE, Chrome, and other browsers to not know how to handle those type of virtual host requests in the same manner that your IIS 7.5 can handle it.

The only work around currently available is to do the following, quoted:

Internet Explorer, Windows Explorer and Virtual FTP Sites issue

Both the Internet Explorer and Windows Explorer first try to connect to FTP server anonymously. If they fail, then they prompt for credentials.When FTP 7 is only configured with virtual host name based sites, these clients fail. Anonymous logon will be be rejected by server the way, that is valid as far as FTP specification (RFC 959) goes, nonetheless, it confuses the authentication sequence of those clients. Robert McMurray, noticed the problem long time ago and proposed a simple workaround in the following blog http://blogs.msdn.com/robert_mcmurray/archive/2008/12/17/ftp-clients-part-3-creating-a-global-listener-ftp-site.aspx.

To address the problem, you would need to create a GlobalListenerFtpSite, that is not configured with a host name. It has to deny anonymous access. As a matter of fact you should not allow any access to the site (leave the authorization section empty). This site will reject the anonymous logon the way that is friendly to IE and Windows Explore. Everything will then work as expected. Robert's blog entry will provide more information on the topic.

You can find out much more in-depth information from the following article and write up: Addressing the “|” separator problem for virtual FTP Sites (FTP 7.5).

4

I don't really understand what the real error is.

You should connect using ftp://username:[email protected]. The fact that you think that you need to pass the domain in your username doesn't make any sense to me.

But in your example you use the | in your username and your browser will try and change that to something with %. I think you should check the error logs and get back on that.

1

Passing only the username will not work the way you want it to, i.e. having to enter only the password after that. When you send the URL as

ftp://user@host:port

The server will try to authenticate you without any password, but as it will fail, the server will ask for the username and password again. So you have to enter them both again in the dialog box that appears.

I tried in Chrome. The username is wiped from the URL even before pinging the server. Firefox won't even load the page and Opera, using its inbuilt FTP manager, says authentication failure and asks for both username and password.

0

Ideally, the format you are looking for is ftp://user@website.

However, the results of using such an address depend on the client browser and not on the web-server.

Firefox will do exactly what you ask for, prompting only for the password.
Internet Explorer will ignore the specified user and ask for both.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .