Naughter Software Logo

CFTPTransferDlg & CFTPTransferer v1.24

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 2017 project to build a simple dialog based app which performs FTP uploads and downloads to any FTP server.

 

Copyright

 

Updates

v1.24 (17 April 2022)

v1.23 (12 December 2021)

v1.22 (4 April 2020)

v1.21 (27 December 2019)

v1.20 (29 September 2019)

v1.19 (6 May 2019)

v1.18 (6 December 2018)

v1.17 (23 December 2017)

v1.16 (5 October 2017)

v1.15 (24 January 2017)

v1.14 (18 May 2008)

v1.13 (30 December 2007)

v1.12 (10 June 2007)

v1.11 (18 May 2007)

v1.10 (14 April 2007)

v1.09 (23 November 2006)

v1.08 (13 June 2003)

v1.07 (30 October 2002)

5 June 2002

v1.06 (20 April 2002)

v1.05 (2 February 2002)

v1.04 (17 October 2001)

v1.03 (10 October 2001)

v1.02 (11 June 2001)

10 December 2000

v1.01 (31 October 2000)

v1.0 (4 January 2000)