Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Is there a reason why you can't simply use: ftp://username:[email protected] ? –  iglvzx Dec 3 '11 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. –  Fly_Trap Dec 5 '11 at 11:43
add comment

migrated from stackoverflow.com Dec 2 '11 at 23:59

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 5 down vote accepted
+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).

share|improve this answer
add comment

i dont 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 doesnt make any sense to me.

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

share|improve this answer
add comment

Passing only 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, server will ask for the username and password again. So you have to enter them both again in the dialog box that appears.
Tried in Chrome, the username is wiped from url even before pinging the server. Firefox wont even load the page and Opera, using it's inbuilt ftp manager, says authentication failure and asks for both username and password.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.