Downloading a file over FTP is as simple as downloading files over HTTP. If it is an anonymous FTP server for which you do not need an authentication, just use the URL as we did before. Assuming that there is again a file called version.txt on the FTP server on the localhost, type this:
That's all; everything else stays the same. If the FTP server requires an authentication, you'll get an error; consider this example:
Likewise, setting the username and password to access an FTP server is easy—either write it in the URL, or use the setUserName() ...