![]() |
Network Dual-Stack Component
Version 7.0 (Beta)
MDK-Professional Middleware for IP Networking
|
Functions to work with the FTP server. More...
Functions to work with the FTP server.
Like all services, the FTP server is normally started automatically if Start System Service is enabled in the Net_Config.c configuration file. If it is disabled, the FTP server needs to be started manually in the user application using netFTPs_Start. At runtime, it is always possible to stop the FTP server using the function netFTPs_Stop. The user application can check for a running server using the netFTPs_Running function.
To change the port of the FTP server at runtime, first call netFTPs_Stop (if the server is running) and then use the netFTPs_SetPort function. Afterwards, the FTP server needs to be (re-)started by the application calling netFTPs_Start.
Code Example
The FTP server supports a built-in user account if the FTP_SERVER_AUTH_ADMIN
is set to 1. In this case, the user specified by FTP_SERVER_AUTH_USER
is created and the password FTP_SERVER_AUTH_PASS
is used for this user. The FTP server control interface provides functions to work with this built-in account. To retrieve the username in the application, use netFTPs_GetUsername. To change this username at runtime, use netFTPs_SetUsername. The same pair of functions is available for managing the password (netFTPs_GetPassword/netFTPs_SetPassword).
It is also possible to check if this login is active (netFTPs_LoginActive) and to enable or disable it at runtime using netFTPs_LoginOnOff. Please note that the function netFTPs_LoginOnOff is only available at runtime if the define FTP_SERVER_AUTH_ENABLE
is set to 1 in the Net_Config_FTP_Server.h file. Otherwise, this command will not be compiled into the project to save resources. For more complex account management, use the Access and Multi-User Interface.