Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

June 1, 2006

FTP Callbacks in C++ for Progress Monitoring

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>


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.