ftp: FTP Functions

Top  Previous  Next

FTP functions are used to send and receive files by using FTP (File Transfer Protocol).

FTP is an internet standard (RFC 959) for file transmission across IP networks.

 

The RTCU devices exclusively uses Passive (PASV) mode for file transfer.

 

Note:

On many FTP servers, the name of files and folders are case sensitive.

The handling of error situations like lost connection may vary from server to server.

 

Secure connection

For NX32L devices, support for FTPS (FTP secure) is available using TLS (TLS v1.2, v1.1 or 1.0).

 

To use secure connection:

1. Ensure the root certificate needed to verify the FTP server is present.

2. When calling ftpConnect set the 'security' to the required type of security. E.g. 'security := 1' (use FTPS if the server supports this).

 

 

Functions used for server communication:

 


ftpOpen

Opens the FTP interface.


ftpClose

Closes the FTP interface.


ftpConnect

Connects to server.


ftpConnected

Checks connection to server.


ftpDisconnect

Disconnects from server.


ftpCancel

Cancel last file transfer.


ftpLastResponse

Gets last server response.


ftpSendOpts

Send options to the server.

 

 

Functions operating on directories:

 


ftpDirChange

Changes working directory.


ftpDirCreate

Creates a directory.


ftpDirCurrent

Gets working directory.


ftpDirDelete

Deletes a directory.


ftpDirRename

Renames a directory.


ftpDirCatalogGet

Fetches catalog.


ftpDirCatalog

Gets an entry from a fetched catalog.

 

 

Functions operating on files:

 


ftpFileDelete

Deletes a file.


ftpFileReceive

Receives a file.


ftpFileRename

Renames a file.


ftpFileSend

Sends a file.


ftpFileSize

Gets the remote size of a file.

 

 

 

Receiving / sending a file over FTP

 

The following sequence is required to send or receive a file:

1.

ftpOpen

Initialize the FTP functions.

2.

ftpConnect

Connect to server.

3.

ftpFileSend / ftpFileReceive

Send/receive a file.

4.

ftpDisconnect

Disconnect from server.

5.

ftpClose

Finish working with FTP.

 


The implementation of FTP has the following limitations:

 

Only passive FTP is allowed.

An IP-network connection must be available.

File system must be present and open for sending and receiving files.

When fetching catalogs, only the first 64 files in 8.3 format are listed.