Link to home
Start Free TrialLog in
Avatar of Henrie
HenrieFlag for Belgium

asked on

idFTP won't connect anonymous

Just trying my first proggie in Delphi7.
Using idFTP to make an ftp client I am trying to connect to an ftp site as an anonymous user:
   IDFtp1.Host := 'ftp.nai.com';
   IDFtp1.Username:='anonymous';
   IDFTP1.Connect;
The connection is made from a system connected directly to the internet without a firewall, proxy, or whatsoever.
When connecting, after a few secs I get a (Delphi) message stating 'user anonymous@ftp.nai.com can not log in'

The same proggie connects fine on another system behind a proxy server. For that I have enabled the proxysettings of idFTP.

Any ideas what could I be doing wrong?
Avatar of Wim ten Brink
Wim ten Brink
Flag of Netherlands image

For some FTP servers you need to use an email address as password. Your email address. You just don't provide any, thus the FTP server refuses you access to the site.
Try setting the password to your email account...

I could be wrong, though. In that case, ignore my answer. :P
Avatar of Henrie

ASKER

Thanks Alex, I already tried the same with an email password but forgot to mention it. It didn't work either. Bu the way ftp.nai.com accepts connecting without a password.
Avatar of bpana
bpana

set up the Passive property to True
IDFtp1.Passive := True;
ASKER CERTIFIED SOLUTION
Avatar of ErikPhilips
ErikPhilips
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Henrie

ASKER

Thanks guys! The next line of code was the fix to the problem:

  IdFTP1.ProxySettings.ProxyType := fpcmNone;

The ProxyType property was set (by myself) to 'fpcmUserSite' in the components' setting (not in code), because I was using a proxyserver when I started this project.

Erik, you get the points, your code indeed worked on a new form and new object so I knew it had to be my form and object settings.

Thanks again for helping a beginner ;-)