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

July 27, 2007

FTP Progress Monitoring with FileZilla Server (and others)

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.

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

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