FTP Wanderer -- An FTP Client Using WININET



Click here for a larger image.

Introduction

This article presents a fully functional implementation of an FTP client.
FTP Wanderer is a multithreaded FTP client with the look and feel of Windows Explorer, and makes moving files between the Internet and your computer as simple as local file manipulation. This application uses WININET APIs to handle the FTP protocol, and while it's not the most elegant way to connect to a FTP server, it does the job pretty well.

Features List

  • All file transfer requests are handled in the background, so you don't have to wait while files copy to continue browsing the current server. You can even connect to a different server while file transfers on another server are still in progress.
  • The Transfer Manager shows all file transfers currently in progress plus the ones that are in the queue. You can configure how many transfers are processed simultaneously, so you don't run out of resources.
  • FTP Wanderer uses the Windows 9x/NT/XP style list boxes for displaying the contents of remote servers. It has all the familiar system icons and context menus.
  • You can specify the number of times it should try to connect, and the time delay between connection attempts.
  • Full Drag-and-Drop support. Simply drag one or more files or even complete folders onto FTP Wanderer's file view area to transfer them to the location of the server that is currently connected.
  • Easily configure FTP site settings such as username, password, port, initial remote folder, number of retries, and default download folder.

Here's a brief description of some of the important classes of the application:

CMainFrame

CMainFrame contains most of the code for managing the FTP connection. It takes care of connecting to the server, initiating up/downloads, and handling other FTP-related actions.

CFTPListView

This is just a CListView-derived class that takes care of displaying the files and enabling you to sort them. When the application is busy downloading or sorting a directory listing, it can display an animation, just as Explorer does.

CConnectDlg

This class (= Site Manager) enables the user to manage FTP sites. You can add/change and delete sites and configure properties such as hostname, port, username, and password. The settings of each site are saved to disk using serializing.

CTransferManagerDlg

CTransferManagerDlg (= Transfer Manager) takes care of queuing the file transfers. It shows all file transfers currently in progress plus the ones that are in the queue. You can configure how many transfers are processed simultaneously, so you don't run out of resources. Each up/download is handled in a separate thread by initiating a CDownloadThread or CUploadThread thread.

CDownloadThread

Each download is handled in the background by using a separate thread. CDownloadThread creates a new connection with the FTP server and displays a progress dialog that tells you the status of the file transfer. When the download is completed (or aborted), it notifies the transfer manager so the UI can be updated.

CUploadThread

Each upload is handled in the background, using a separate thread. CUploadThread creates a new connection with the FTP server and displays a progress dialog that tells you the status of the file transfer. When the upload is completed (or aborted), it notifies the transfer manager so the UI can be updated.

To Do List

Although this application has most of the features you might expect in a FTP client, there are a few things left to do:

  • Drag-and-drop support out of the file view area to Explorer. I think this one is not that easy because this would probably "block" Explorer until the file transfer is completed. Any suggestions?
  • Progress indication in the transfer manager. This is not really that hard to do, so it will probably be in the next release.
  • Better asynchronous handling of getting a directory listing. The UI now does not respond when downloading a huge directory listing.

For more cool projects, visit Pablo Software Solutions.

Downloads

Download demo executable - 105 Kb
Download source - 152 Kb


Comments

  • Thanks

    Posted by Legacy on 08/14/2003 12:00am

    Originally posted by: Stefan

    Thank you for sharing your good and well documented source code with us.

    Reply
  • DownLoading A whole Website

    Posted by Legacy on 08/07/2003 12:00am

    Originally posted by: NKO

    I've wrote A NT Service Program which DownLoad the Whole Website via www.CodeGuru.com/.../.../(all Link) From Internet.I've Big Problem in Internet COnnection which Connection Break Down,My Program is Can't Pending and Abort.And Connection is ReConnect,DownLoad From Starting Page.
    How Can Pending on Current Page while Connection is Break-Down and Resuming From Last Page.
    Please Help me....If U Can...
    I'm Using MFC....
    Thank U so Much
    :confused::confused::confused:

    Reply
  • Resume a broken download? -

    Posted by Legacy on 07/15/2003 12:00am

    Originally posted by: sky

    During transfring file if server connection gets failed ,I want resume it.how could i do?
    thanks.

    Reply
  • Good! Thanks! But...

    Posted by Legacy on 04/11/2003 12:00am

    Originally posted by: coolsprite

    When download directory tree, subdicectories' name may lost a '\'. So they are at the same level as parent dir.

    Reply
  • Proxy authentication

    Posted by Legacy on 09/03/2002 12:00am

    Originally posted by: David

    Our proxy requires authetication and it is not possible to establish connection using your software

    Do you have the intention to support connections through a local proxy authentication server in future versions ?

    Reply
  • Resume File transfering

    Posted by Legacy on 08/31/2002 12:00am

    Originally posted by: Murali.Y


    I'm working in VC++ as prof. i'm using ur code in FTP source code but in between transfring file if server connection gets failed . than i want to resume that file from where it gets failed how can i add this option in this code. Plz help me out.
    if this will possible than ur code will really helpufufor me and i appreciate this code.

    Regards

    Murli Y
    Software Engg
    Focus Infosys(I) Pvt Ltd
    Bangalore
    E-Mail: Murali@focusmt.com

    Reply
  • Proxy Server Support

    Posted by Legacy on 08/30/2002 12:00am

    Originally posted by: Christiaan


    Do you have the intention to support connections through a local proxy server in future versions ?

    Reply
  • Does WinInet support PASV mode?

    Posted by Legacy on 08/28/2002 12:00am

    Originally posted by: Bruise

    long time ago, i give up using winint-ftp just because it does not supporting ftp passive mode.

    Reply
  • Cool and visit Pablo software

    Posted by Legacy on 08/23/2002 12:00am

    Originally posted by: Yarp

    Very nice FTP client. I was looking for something like this for a long time, I think FTP Wanderer will become my FTP tool.
    Just one thing : the Add button in the Site Manager button is a little ambiguous. I erased a ftp connection setting with it, it didn't add a new connection but erased the one I was on before.

    You really offer good software solutions from your web site. I will give the setup builder a try.

    Yarp

    Reply
  • parse urls like ftp://site.domain/path

    Posted by Legacy on 08/22/2002 12:00am

    Originally posted by: anonymous

    Cool, thanks !

    But I think it would be a useful addition if FTP wanderer could parse urls in the form of ftp://site.domain/path. I find myself often pasting these urls from the explorer to an ftp application, deomposing them manually thereafter.

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds