I'm trying to use IdFTP to connect to a web host. The .List line is giving me a huge problem that I've yet to solve. I keep getting Socket Error 10054. What I'm trying to do is make an auto update feature that alerts the user when a new version is out but when it gets to to List part, it hangs, then it gives me the 10054 socket error. I debugged it and I am 100% absolutely positive it's the .List line. I know what 10054 is, I just don't know what is in my .List that is causing it (I know it is not the web host because the person who gave me this host says he does the same type of FTP codes in Delphi I do and they work for him).

procedure TForm1.BrowseEnter(Sender: TObject);
var
  x:TStrings;
  i:integer;
  s:string;
  n:string;
begin
  x := TStrings.Create;
  IdFTP1.Host := 'withheld';
  IdFTP1.Username := 'withheld';
  IdFTP1.Password := 'withheld';
  IdFTP1.Connect;
  IdFTP1.ChangeDir('public_html');
  idFTP1.List(x, 'pb*', false);
  IdFTP1.Disconnect;
  n := x[0];
  for i := 1 to length(n) do
  s := s + s[i];
  if not (n = s) then begin
    ShowMessage('Update');
  end;
end;

Id guess you'd want passive ftp. Which a number of ftp apps do by default.

I've already set IdFTP to be in passive mode.

Is it all directory listings, or just 1 directory?

It is one directory. public_html.

Well, its timing out for some reason.. either because its returning an error or returning something and your code hasnt allowed for it..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.