Project DescriptionSystem.Net.FtpClient is a client implementation of the FTP protocol that is designed to be easy to use and easy to extend. Aside from normal FTP client features, it supports SSL/TLS connections for command and data channels and parsing various file listing formats. This project is being developed with C#.
This code is still very much a work in progress. It's currently in alpha status and will remain there until I end up with what I feel is a stable API. Although there are probably bugs, don't let the alpha tag fool you. I'm working hard to make and keep what's already published as solid as can be expected from a project that is still under early and heavy development. You can expect API changes that might break your own code compilation from time to time. I will do my best to document these kind of modifications as thoroughly as possible in the revision and active release comments.
OverviewSystem.Net.FtpClient is comprised of several classes. The core classes are FtpControlConnection and FtpDataStream. The FtpControlConnection class implements only the necessary features for connecting to a FTP server and opening data connections. The FtpDataStream class, as you might have guessed, handles the data streams for file downloads and file listing (and anything else that might require a data channel).
The FtpClient class is a more functional implementation of the FTP protocol. It extends FtpControlConnection to provide an easy to use FTP implementation. Most people will probably not need anything more than FtpClient. If you want a more stream lined implementation for special cases,
Extending System.Net.FtpClient is probably where you want to start.
I've created a branch of the code base for a new implementation of the ideas and lessons I have learned since starting this project. The new code base (FtpClient2ndGen) aims to be simple (code and API) and thread safe in regards to performing transactions on the same control object. While the API is similar, it is not identical. Another notable difference in behavior is support for multiple data streams using a single control connection (well not really because the protocol doesn't support this behavior however the necessary processes to make this transparent to the application are handled internally). You can obtain the new code either through the download link in the Source Code section (make sure you select the proper branch first) or for those of you that are unfamiliar with mercurial (I'm not all that familiar myself, still learning) you can clone the new code base with the following command (tested with TortoiseHG):
hg clone -u FtpClient2ndGen https://hg01.codeplex.com/netftpBugsIn order to get help and in turn help others by getting bugs fixed please use the discussions section where we can talk and try to get to the bottom of any problems. If you're fairly certain you've found a bug in the System.Net.FtpClient code then make a detailed bug report in the Issue Tracker. It's worth taking a look over the Source Code section and reading the commit comments to see if a particular bug has already been addressed in a newer revision than what you might be using. Please do not use the release reviews to post about errors. If you want to leave a bad review then that is your prerogative but if you want to report an error do so through the proper channels so that we can discuss the problem in a public manner that helps everyone.
When you encounter a bug there are a few important things that you can include that will go a long way in helping to resolve the matter. Aside from a good description of how to reproduce the problem, include with your report the transaction log, the exact revision number, and the exact version of the server OS and ftp software tat you were connected to when the problem occurred. I realize that some of this information may not be available but if it is please be sure to include it.
As of revision 8384 I've added a way to log the server transactions in release or debug builds. There are a couple of new static properties in FtpControlConnection that allow this to take place. The first is FtpLogStream which is a stream to write the transactions to. The second is FtpLogFlushOnWrite which forces a flush on the stream every time it's written to. This option is useful for console logging to keep the transactions in sync with other output going to the console. The stream can be a file, stdout, stderr, whatever... it doesn't matter. In addition, passwords are omitted from the logging output. An example of enabling console logging:
static void Main(string[] args) {
FtpControlConnection.FtpLogStream = Console.OpenStandardOutput();
FtpControlConnection.FtpLogFlushOnWrite = true;
......
}
DownloadsI will periodically set an alpha revision as the current release with a binary download as I deem said revision to be stable enough to use. Until a beta release is ready, I recommend downloading the latest source revision. I'm making an effort to not commit any broken code however I can't guarantee that won't happen. It would benefit us all though if people used the latest revision and submitted bug reports as needed.
Feature RequestsIs this library lacking something you need? If so please let me know and I will gladly look into the matter. If you're comfortable with the inner-workings of this library and you don't want to wait, you can extend the functionality without messing with the core code. Please have a look at
Extending System.Net.FtpClient for the details on adding functionality.
A note about the SITE command: It is unlikely that I will add site specific command support to the core library, however if you need assistance in figuring out how to execute said commands I will gladly assist. If you don't want to wait, have a look at the example above, it is the starting place.