The MockFtpServer (http://mockftpserver.sourceforge.net/) project provides a mock/dummy FTP server implementation that is very useful for testing of FTP client code. It can be configured to return custom data or reply codes, to simulate either success or failure scenarios. Expected command invocations can also be verified.
MockFtpServer is written in Java, and is ideally suited to testing Java code. But because communication with the FTP server is across the network using sockets, it can be used to test FTP client code written in any language.