65.9K
CodeProject is changing. Read more.
Home

CFTPTransferDlg v1.0 - The FTP Protocol

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.44/5 (8 votes)

Mar 4, 2000

viewsIcon

160326

downloadIcon

2991

A dialog implementation that performs a FTP file transfer.

  • Download source files - 42 Kb
  • Sample Image - FTPTransferDlg.gif

    Introduction

    CFTPTransgerDlg provides an MFC dialog which performs FTP uploads and downloads similar to the Internet Explorer download dialog as shown above.


    History
    Usage
    Contacting the Author


    History

    v1.0 (4 January 2000)
    • Initial public release.


    Usage

    To use CFTPTransferDlg in your project simply include FTPTransferDlg.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 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_sLocal = _T("c:\\somfile.ext");
    dlg.m_bDownload = TRUE;
    dlg.m_bBinary = TRUE;
    if (dlg.DoModal() == IDOK)
       AfxMessageBox("File was downloaded successfully");
    

    You should also have a look at the CFTPDlg::OnDownload() and CFTPDlg::OnUpload() code in the sample application.


    Contacting the Author

    PJ Naughter
    Email: pjn@indigo..ie
    Web: http://www.naughter.com
    4th January 2000