Configure periodic file transfer via FTP
Combine FTPClientLogic
and PeriodicActionLogix
to automate the upload and download of files and folders in a periodic and non-interactive manner. You can use this FTP server configuration to automate file and folder transfers between devices.
- Create the folder C:/FtpServer and inside that folder create the file myDocument.txt.
- Set C:/FtpServer as the starting folder on the FTP server.
- Start the FTP server.
-
To use the FTP server that exists in Template Libraries, see FTP Server configuration, and configure the connection parameters to the FTP server in the
FTPClientLogic
script.The files and folders to be transferred are already configured through
FileTransferDownload
andFileTransferUpload
.The pages in the project include:
- FTP client configuration. Allows you to change the configuration parameters of the FTP client. The
OverwriteExistingItems
switch defines whether an existing file must be overwritten. - Transfer files. Shows how to connect and disconnect the FTP client using the
ConnectFTPClient
andDisconnectFTPClient
methods and how to download and upload using theDownloadItem
andUploadItem
methods. - Periodic backup method. Allows you to enable periodic downloading of a given file using the
PeriodicActionLogic
script. The script is configured withPeriod
set at 30 seconds andAction
set to DownloadItem. See Download example.
- FTP client configuration. Allows you to change the configuration parameters of the FTP client. The