CCLFTP is an embedded FTP server library based on mooftpserv. Updated to .Net Standard 1.3, this version forgoes Windows CE support - and has been broadly updated to modern coding/design standards.
It has been tested with FileZilla, Total Commander, GNOME Nautilus, Windows Explorer, Firefox and Chrome as clients.
This repository includes a small executable that can be directly used as a command-line FTP server.
mooftpserv.exe [-h|--help] [-v|--verbose] [-p|--port <port>] [-b|--buffer <kbsize>] [-a|--any-peer]
- -h | --help Show the usage description
- -v | --verbose More verbose logging
- -p | --port TCP/IP server port on which to listen for new connections (default: 21)
- -b | --buffer Size of the per-session data connection buffer (in kilobytes, default: 64)
- -a | --any-peer Allow data connections from/to any peer, instead of restricting to the same address as the control connection. (aka host-to-host transfers)
The FTP server itself is implemented in a library, so that it can be embedded into other applications. Create an instance of
mooftpserv.Server and call the synchronous
Run() method to start the server.
The server implements only basic FTP commands. The following commands are supported (at least in some limited fashion):
OPTS (only for OPTS UTF8 ON, which is always active anyway) SYST QUIT USER PASS FEAT TYPE PORT PASV PWD CWD CDUP XPWD XCWD XCUP MKD RMD RETR STOR DELE RNFR RNTO XMKD XRMD MDTM SIZE LIST NLST STAT (only with a path as argument, where it acts like LIST, but over the control connection) NOOP
FEAT reports the following supported features:
MDTM PASV SIZE TVFS UTF8
There are some options for customization when used as a library, made available as Properties of the
LocalPortto set the server address and port on which to listen for incoming connections (default: port 21, address 0.0.0.0)
BufferSizeto specify the size of the data connection buffer for each session (in kilobytes, default: 64)
AuthHandlerto provide a handler for authenticating users and authorizing control and data connections (default:
mooftpserv.DefaultAuthHandler, accepts username "anonymous" without password, allows all control connections, and optionally all data connections)
FileSystemHandlerto provide a handler for file system access (default:
mooftpserv.DefaultFileSystemHandler, implements and allows access to the real file system, on Unix starting at "/", on Windows CE starting at "", and on Windows NT starting with all available drives)
LogHandlerto provide a handler for log output (default: null)
Timestamps are always UTC. The control connection always uses UTF8, and the LIST response does too.
One thread per control connection is used. Data connections also run in that thread, thus blocking their control connections.
Server-to-server transfers are supported, but disabled by default. They can be enabled in the
DefaultAuthHandler or restricted by implementing a custom
The source code is licensed under the MIT license. Its full text is included in the LICENSE file.