Click here to Skip to main content
Click here to Skip to main content

FTP Wanderer - FTP Client using WININET

, 30 Jul 2002
Rate this:
Please Sign up or sign in to vote.
This article presents a fully functional implementation of a FTP client.

Sample Image

Description

This article presents a fully functional implementation of a 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 API's 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. With all 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, like 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; initiate 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 like 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 save 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 in handled in a separate thread by initiating a CDownloadThread or CUploadThread thread.

CDownloadThread

Each download is handled in the background 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:

While 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 this will probably be in the next release.
  • Better asynchrony handling of getting directory listing. The UI now does not respond when downloading a huge directory listing.

Contacting the Author

Please send any comments or bug reports to me via email. For any updates to this article, check my site here.

Revision history

  • 31st July 2002 - Initial revision.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Pablo van der Meer
Web Developer
Netherlands Netherlands
No Biography provided

Comments and Discussions

 
GeneralI'm Very Impressed PinmemberPeter Coppinger1-May-04 3:12 
GeneralRe: I'm Very Impressed PinmemberRavi Bhavnani1-May-04 4:48 
GeneralRe: I'm Very Impressed PinmemberPablo van der Meer1-May-04 4:57 
QuestionHow to exit ftp immediately? Pinmemberwheregone3-Nov-03 18:25 
AnswerRe: How to exit ftp immediately? PinmemberPablo van der Meer3-Nov-03 21:18 
GeneralRe: How to exit ftp immediately? Pinmemberwheregone4-Nov-03 2:24 
Generalblocks connection when Ftp-Server disconnected PinmemberNielsR17-Oct-03 1:42 
GeneralRe: blocks connection when Ftp-Server disconnected PinmemberPablo van der Meer17-Oct-03 1:47 
Just set the timeout to a reasonable value.
See the latest sourcecode at : http://www.pablovandermeer.nl!

QuestionBug on CInternetSession::SetOption??? Pinmembernaghicalin16-Oct-03 12:24 
AnswerRe: Bug on CInternetSession::SetOption??? PinmemberNielsR17-Oct-03 1:17 
QuestionBug ? Pinmemberrpascal1-Oct-03 21:45 
AnswerRe: Bug ? PinmemberPablovanderMeer1-Oct-03 21:58 
GeneralUpload problem Pinmemberigorss29-Sep-03 4:13 
GeneralFtpCommand PinmemberNielsR29-Sep-03 2:44 
GeneralRe: FtpCommand PinmemberPablovanderMeer29-Sep-03 3:18 
GeneralRe:FTP Connection not working Pinmembergirishnadig18-Sep-03 7:44 
GeneralDear Pablo PinmemberJerry Evans21-Aug-03 23:34 
GeneralResolving symbolic links PinmemberJohn Simmons / outlaw programmer26-Mar-03 11:09 
QuestionResume transmission at the point of interruption? Pinmembernothingremained20-Oct-02 3:42 
AnswerRe: Resume transmission at the point of interruption? PinmemberMarcelo N. Magri28-Jan-03 5:58 
AnswerRe: Resume transmission at the point of interruption? PinmemberPablovanderMeer26-Mar-03 11:30 
AnswerRe: Resume transmission at the point of interruption? PinmemberNarendra Chandel17-Jun-03 12:35 
GeneralBug PinsussAnonymous16-Sep-02 5:33 
GeneralRe: Bug PinmemberVCPP621-Aug-04 3:37 
GeneralRe: Yes, It is very critical Bug PinmemberVCPP621-Aug-04 3:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 31 Jul 2002
Article Copyright 2002 by Pablo van der Meer
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid