-
-
Notifications
You must be signed in to change notification settings - Fork 680
FXP Server To Server
Robinicks edited this page Feb 20, 2020
·
23 revisions
- FXPDataType - Controls if the FXP server-to-server file transfer API uses Binary or ASCII mode. Default: Binary.
FXP works by creating a data connection between two FTP servers. FluentFTP can then instruct the source server to start transferring the file and instruct the target server to receive and store it.
You need to call the API in this order:
- You need to create an
FtpClientinstance and connect to the source server - You need to create an
FtpClientinstance and connect to the target server - Call
source.TransferFileorsource.TransferDirectoryon the source FTP client
The order of FTP commands is as follows:
- We connect to the source server
- We clone the connection of the target server and reconnect to it
- Internally, we open a passive FXP connection between the source server and target server by calling
OpenPassiveFXPConnection() - We maintain an
FtpFxpSessionobject used to track the active FXP connection between 2 servers - Internally, we instruct the source server to send the file, using the
RETRFTP command - Internally, we instruct the target server to store the file, using the
STORFTP command - If there are any connection issues, we resume transfer by instructing the source server to resume using
RESTandRETRFTP command and the target server to store append the file usingAPPEFTP command - We can only check the file transfer progress by constantly sending the
SIZEcommand on the target server to check how many bytes have transferred - At the end of transferring the file we optionally verify the file using any mutually supported hash method and then call
GetChecksum()on the source and target server and check if the hash matches - Finally, we disconnect from source and target servers and the
FtpFxpSessionis disposed off
- Auto Connection
- Auto Reconnection
- FTP(S) Connection
- FTP(S) Connection using GnuTLS
- FTPS Proxies
- Custom Servers
- Custom Commands
- v40 Migration Guide