-
-
Notifications
You must be signed in to change notification settings - Fork 659
Custom Servers
FluentFTP supports many server types out-of-the-box. However if your company or your hardware is running a non-standard FTP server that does not properly support the FTP protocol, you can customize FluentFTP to work with it. FluentFTP has a variety of properties that let you configure its behavior (check the feature pages for relevant properties).
FluentFTP also has a flexible server system. All server-specific routines for standard FTP servers are implemented in a classes extending from FluentFTP.Servers.FtpBaseServer
. Therefore to support a non-standard server you can simply create a class in your project extending this base class and add your custom handling routines in there.
- Create a new class extending
FluentFTP.Servers.FtpBaseServer
. Lets call itYourFtpServer
. For examples you can look here. - After creating your
FtpClient
setclient.ServerHandler = new YourFtpServer();
. Make sure you do this before youConnect()
to the server. - If your FTP server outputs file listings in a non-standard manner, you can implement a custom listing parsing method and then set that method on
client.ListingCustomParser
(example). - Call
client.Connect()
and then use FTP methods as usual - Viola!
Your class that extends from FluentFTP.Servers.FtpBaseServer
supports these extendable handlers, so that you can implement server-specific behaviour.
All of these are optional. You only need to implement the ones you want and the non-implemented ones will automatically fallback to default handling.
Method | Description | Used for |
---|---|---|
RecursiveList |
Detect if your FTP server supports the recursive LIST command (LIST -R). If you know for sure that this is supported, return true here. | Improving performance of LIST command |
DefaultCapabilities |
Return your FTP server's default capabilities. Used if your server does not broadcast its capabilities using the FEAT command. | Getting server capabilities |
IsAbsolutePath |
Return true if the path is an absolute path according to your server's convention. | Supporting weird path formats |
GetParser |
Return the default file listing parser to be used with your FTP server. | Parsing directory listings |
DeleteDirectory |
Perform server-specific delete directory commands here. Return true if you executed a server-specific command. | Improving performance of DeleteDirectory |
DeleteDirectoryAsync |
Perform async server-specific delete directory commands here. Return true if you executed a server-specific command. | Improving performance of DeleteDirectory |
CreateDirectory |
Perform server-specific create directory commands here. Return true if you executed a server-specific command. | Improving performance of CreateDirectory |
CreateDirectoryAsync |
Perform async server-specific create directory commands here. Return true if you executed a server-specific command. | Improving performance of CreateDirectory |
- Auto Connection
- Auto Reconnection
- FTP(S) Connection
- FTP(S) Connection using GnuTLS
- FTPS Proxies
- Custom Servers
- Custom Commands
- v40 Migration Guide