How to determine FTP Put success?

Giganews Newsgroups
Subject:How to determine FTP Put success?
Posted by: Larry Houbre
Date:Tue, 20 Jan 2009

I'm using Indy 10.2.3, CodeGear Rad Studio, Delphi 2007 for Win32.

I was getting the occasional freeze when the connection would drop, so I upgraded to the 10.2.3 from 10.1.5. Now I don't get the freeze, but I don't get a reliable idication that the file was sent successfully.

Here's part of the code:

  Result:=true;
  Try
    fFTP.TransferType:=ftBinary;
    fFTP.Put(aLocal,aRemote);
    Result:=True;
  Except
    on E:Exception do begin
      LogError(E.Message);
    end;
  end;

I'm getting a result TRUE even though the file is NOT completely transferred. Tracing, I discover an EIdSocketError is raised: Socket Error 10053, then the finally in that (InternalPut) method calls FinalizeDataOperation which then calls GetResponse, which triggers EIdConnClosedGracefully. My except block does not run.

What am I doing wrong?
Thanks!
Larry

Replies