Functions to connect to an FTP server. More...
Functions | |
netStatus | netFTPc_Connect (const NET_ADDR *addr, netFTP_Command command) |
Start FTP client file operation session. [thread-safe]. | |
Functions to connect to an FTP server.
The FTP client session starts with a connect request using netFTPc_Connect. The FTP client then opens a FTP connection to the server. The FTP command that is to be performed by the FTP server is specified in the connect request parameter. Once the operation has completed, the FTP session ends and the connection closes. If you want to issue another command or transfer files, you need to start a FTP session again.
netStatus netFTPc_Connect | ( | const NET_ADDR * | addr, |
netFTP_Command | command | ||
) |
Start FTP client file operation session. [thread-safe].
[in] | addr | structure containing IP address and port of remote FTP server. |
[in] | command | FTP command to perform. |
The function netFTPc_Connect starts the FTP client. The FTP client then connects to a FTP server specified with the argument addr which points to a buffer containing the IP address and port of the FTP server. If the specified port is 0, the client uses a standard FTP server port 21 to connect to the server.
The argument command specifies a command that is preformed when the FTP client connects to the FTP server. The following commands are supported:
Command | Description |
---|---|
netFTP_CommandPUT | Puts a local file from local system to FTP server |
netFTP_CommandGET | Retrieves a file from FTP server to save as a local file |
netFTP_CommandAPPEND | Appends a local file to an existing file on FTP server |
netFTP_CommandDELETE | Deletes a file from FTP server |
netFTP_CommandLIST | Lists files located on FTP server (including detailed information) |
netFTP_CommandRENAME | Renames a file or directory on FTP server |
netFTP_CommandMKDIR | Creates a new directory on FTP server |
netFTP_CommandRMDIR | Deletes an empty directory on FTP server |
netFTP_CommandNLIST | Lists file names located on FTP server (names only) |
Possible netStatus return values:
Code Example