Uploading a local file to a remote FTP server
You would like to upload a file to an FTP server.
Getting ready
Let us set up a local FTP server. In Unix/Linux, you can install VSFTPD (Very Secure File Transfer Protocol Daemon) FTP Server using the following command:
$ sudo apt-get install vsftpd
On a Windows machine, you can install the FileZilla FTP server, which can be downloaded from https://filezilla-project.org/download.php?type=server. FileZilla can also be installed in Linux. For example, in Debian-based Linux distributions such as Ubuntu:
$ sudo apt-get install filezilla
You should create an FTP user account following the FTP server package's user manual.
You would also like to upload a file to an FTP server. You can specify the server address, login credentials, and filename as the input argument of your script. You should create a local file called readme.txt
with any text in it.
How to do it...
Using the following script, let's set up a local FTP server. Once you have installed the FTP...