I need to test FTP client codes, so I need to find an FTP server for testing my codes. After searching for a while I find out that OS X already equipped FTP server. I am currently using OS X El Capitan 10.11.*.
Let’s now test the FTP server on Mac OS X with the following steps:
- Launch the
- Type the following command to start the FTP server.
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
- Connect to the FTP server by running
- We’ll be asked to enter the
$ ftp localhost Trying ::1... Connected to localhost. 220 ::1 FTP server (tnftpd 20100324+GSSAPI) ready. Name (localhost:wsaryada): wsaryada 331 User wsaryada accepted, provide password. Password: 230 User wsaryada logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp>
- If we see the messages above and the
ftp>prompt means that the FTP server works and ready to accept our command.
- We can also try to access the FTP server using a browser. In the URL box type
ftp://localhostto connect. We need to supply username and password to login.
- To exit or close the connection to FTP server we can run the
- Finally, to shutdown the FTP server we run:
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
After the FTP server ready, I can now continue to create some test program to access the FTP server. There are already some examples you can find in the Apache Commons Net category that use the
FTPClient library to access FTP server.
- How do I format EditText for currency input in Android? - May 21, 2021
- How do I get Android Device ID or IMEI? - May 20, 2021
- How do I print to a Bluetooth thermal printer in Android? - May 16, 2021