Solved

idFTP won't connect anonymous

Posted on 2004-08-06
5
1,192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

628 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