Timeout problem when uploading with TidFTP

Hello all,

I am using the procedure below to upload files using the TidFTP component.

This has been working just fine an all sites except one, which is getting
the following error during the file upload: '421 Timeout (900 seconds);
closing control connection'. Checking the web server confirms that the file
has only partially been uploaded.

The site apparently has a permanent connection to the internet.

Please could someone help me work out why I am having this problem with this
site. I don't know if the problem is in my code, or with thier setup.

Any help or ideas would be gratefully received!

Thanks,

Matt Salmon

Code:

procedure TFormMain.DoFileUpload(LocalFileName: string;
  ProgressBar: TProgressBar);
var
  Progress : Boolean;
  DestFileName : string;
  MyFileStream : TFileStream;
  MyMemoryStream : TMemoryStream;
  Transferred : Integer;
  BlockSize : Integer;
  StdBlockSize : Integer;
begin
  Progress := not(ProgressBar = nil);
  DestFileName := ExtractFileName(LocalFileName);
  StdBlockSize := FStdBlockSize;

  MyFileStream := TFileStream.Create(LocalFileName, fmOpenread);
  try
    if progress then
      ProgressBar.Max := MyFileStream.Size;

    Transferred := 0;

    MyFileStream.Seek(0, soFromBeginning);
    while Transferred < MyFileStream.Size do
      begin
        MyMemoryStream := TMemoryStream.Create;
        try
          if (MyFileStream.Size - MyFileStream.Position) > StdBlockSize then
            BlockSize := StdBlockSize
          else
            BlockSize := MyFileStream.Size - MyFileStream.Position;

          MyMemoryStream.CopyFrom(MyFileStream, BlockSize);
          MyMemoryStream.Seek(0, soFromBeginning);

          if Transferred = 0 then
            idFTP.Put(MyMemoryStream, DestFileName, false)
          else
            idFTP.Put(MyMemoryStream, DestFileName, True);

          Transferred := Transferred+MyMemoryStream.Size;

          if Progress then
            ProgressBar.Position := Transferred;
        finally
          MyMemoryStream.Free;
        end;
        Application.ProcessMessages;
      end;
  finally
    MyFileStream.Free;
  end;
end;