Naughter Software Logo

CFTPTransferDlg & CFTPTransferer v1.15

CFTPTransferDlg provides an MFC dialog which performs FTP uploads and downloads similar to the old Internet Explorer download dialog as shown below:

 

CFTPTransferDlg screen capture

 

To use CFTPTransferDlg in your project simply include FTPTransferDlg.cpp/h and FTPTransferer.cpp/h from the test application in your application and #include "FTPTransferDlg.h" in whichever files you want to use the class in. You should also copy over all the "IDS_FTPTRANSFER_.." string resources, the IDD_FTPTRANSFER dialog resource and the IDR_FTPTRANSFER_ANIMATION "avi" resource to your application. Then to bring up the dialog to upload / download a specific file, just use some code like the following:

CFTPTransferDlg dlg;
dlg.m_sServer = _T("ftp.some-site.com");
dlg.m_sRemoteFile = _T("/somefile.ext");
dlg.m_sLocalFile = _T("c:\\somfile.ext");
dlg.m_bDownload = TRUE;
dlg.m_bBinary = TRUE;
if (dlg.DoModal() == IDOK)
    AfxMessageBox("File was downloaded successfully");

 

Alternatively you can use the CFTPTransferer class (which CFTPTransferDlg uses internally) in a synchronous non-UI manner as follows:

CFTPTransferer transfer;
transfer.m_sServer = _T("ftp.some-site.com");
transfer.m_sRemoteFile = _T("/somefile.ext");
transfer.m_sLocalFile = _T("c:\\somfile.ext");
transfer.m_bDownload = TRUE;
transfer.Transfer();

 

The enclosed zip file contains source code for the classes and also includes a VC 2010 project to build a simple dialog based app which performs FTP uploads and downloads to any FTP server.

 

Copyright

 

Updates

v1.0 (4 January 2000)

V1.01 (31 October 2000)

10 December 2000

V1.02 (11 June 2001)

V1.03 (10 October 2001)

V1.04 (17 October 2001)

V1.05 (2 February 2002)

V1.06 (20 April 2002)

5 June 2002

V1.07 (30 October 2002)

V1.08 (13 June 2003)

V1.09 (23 November 2006)

V1.10 (14 April 2007)

V1.11 (18 May 2007)

V1.12 (10 June 2007)

V1.13 (30 December 2007)

V1.14 (18 May 2008)

V1.15 (24 January 2017)