Re: OnAfterClientLogin

Giganews Newsgroups
Subject: Re: OnAfterClientLogin
Posted by:  Karl (no_email.no_place.home)
Date: Thu, 25 Sep 2003

My understanding is that the FTP components are blocking, which means you
shouldn't need to use events, try something as simple as this:

I don't know if HTML tags work here, but i'll try anyway :)

<pre>
void TForm1::transferPatch(const std::string &inFilename)
{
  AnsiString filename = inFilename.c_str();
  try
  {
    // Connect to the FTP server.
    FTP->Host = "yourhost.com";
    FTP->Username = "username";
    FTP->Password = "password";

    FTP->Connect(true);

    // transfer file
    FTP->TransferType = ftBinary;
    FTP->Put("sourceFileName", DestFileName, false);
    FTP->Disconnect();
  }
  catch(Exception &excetionError)
  {
    ShowMessage(excetionError.Message);
  }
  FTP->Disconnect();
}
</pre>

Or have I missed the point..

Karl..

On Tue, 16 Sep 2003 14:45:39 -0600, Dan <da…@thesourceintl.com> wrote:

> I am trying to have my app login to the ftp server, then change to the
> appropriate directory than transfer files all without any user
> intervention.
> I have found the only event that occurs when after the user logs in, is
> the
> onafterClientLogin event.  When I try to changedir() within the event, I
> get
> the error "unable to build data connection, no route to host".
> If I cannot perform this action here, where should I do it?
> I tried to use the onstatus event and check for a connected status (which
> occurs but prior to logging in apparently) so I was not able to changeDir
> there either.

--
Using M2, Opera's revolutionary e-mail client:http://www.opera.com/m2/

Replies

None

In response to

OnAfterClientLogin posted by Dan on Tue, 16 Sep 2003