The ability to receive PercentDone events for FTP downloads depends on the FTP client knowing in advance how many bytes are forthcoming. Most FTP servers include a byte count in the intermedia "150″ response sent on the control channel in response to a RETR command. For example:
RETR default.asp
150 Opening BINARY mode data connection for default.asp (3992 Bytes).
226 Transfer complete.
The Chilkat FTP2 component can parse the number of bytes that should be arriving and can therefore provide percentage completion events. Some servers, including FileZilla, do not include the byte count in the "150″ response:
RETR screenshot.jpg
150 Connection accepted
226 Transfer OK
In this case, you’ll need to tell the FTP2 client how many bytes to expect. You can do this (using VB.NET as an example):
ftp.ProgressMonSize = ftp.GetSizeByName("screenShot.jpg")
success = ftp.GetFile("screenShot.jpg", "screenShot.jpg")
Call GetSizeByName to get the file size (in bytes) of a specific file. Set the ProgressMonSize property equal to the returned value. The ProgressMonSize property tells the FTP2 component how many bytes to expect for the next download.
One more note: Don’t forget to set the Chilkat.Ftp2.EnableEvents property = true whenever events are to be used, otherwise the component will suppress the events.