Solved

idFTP won't connect anonymous

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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