Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

idFTP won't connect anonymous

Posted on 2004-08-06
5
Medium Priority
?
1,254 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 500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

782 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