Solved

idFTP won't connect anonymous

Posted on 2004-08-06
5
1,077 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

10 Experts available now in Live!

Get 1:1 Help Now