Here is a C++ FTP example for monitoring progress of FTP uploads and downloads:
<font face=\"courier\" size=\"2\">
class MyFtpProgress : public CkFtpProgress
{
void PercentDone(long pctDone, bool *abort)
{
// Set *abort = true if you wish to abort the transfer before completion.
printf("%d Percent Done!\n",pctDone);
}
// Called periodically to check to see if the transfer should be aborted.
void AbortCheck(bool *abort)
{
// Set *abort = true if you wish to abort the transfer before completion.
printf("Abort Check!\n");
}
};
void FtpProgressDemo(void)
{
CkFtp2 ftp;
ftp.UnlockComponent("unlock code");
ftp.put_Hostname("ftp.chilkatsoft.com");
ftp.put_Username("***");
ftp.put_Password("***");
bool b = ftp.Connect();
if (!b)
{
printf("connect failed!\n");
return;
}
MyFtpProgress myProgress;
ftp.GetFile2("ChilkatZipSE.exe","ftp/ChilkatZipSE.exe",myProgress);
ftp.PutFile2("uploadTest.txt","uploadTest.txt",myProgress);
ftp.Disconnect();
}
</font>