Solved

idFTP won't connect anonymous

Posted on 2004-08-06
5
1,094 Views
Last Modified: 2008-01-09
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?
0
Comment
Question by:henrie
5 Comments
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 11735225
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
0
 
LVL 4

Author Comment

by:henrie
ID: 11736309
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.
0
 
LVL 6

Expert Comment

by:bpana
ID: 11737330
set up the Passive property to True
IDFtp1.Passive := True;
0
 
LVL 4

Accepted Solution

by:
ErikPhilips earned 125 total points
ID: 11739758
This seems to work for me, i get 'Connected!'.

procedure TForm1.Button1Click(Sender: TObject);
begin
  ftp1.Host := 'ftp.nai.com';
  ftp1.Username := 'anonymous';
  ftp1.Password := 'test@test.com';
  try
    try
      ftp1.Connect(true, 500);
      ShowMessage('connected!');
    except
      ShowMessage('error!');
    end;
  finally
    ftp1.Disconnect;
  end;
end;
0
 
LVL 4

Author Comment

by:henrie
ID: 11753588
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 ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 189
Comparing dates in Delphi. Greater than/ Less than 3 116
Delphi XE10 Round Image 2 77
tidtcpserver connection lost handle 2 70
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now