/** This file gives an example of uploading a file to an FTP server. It is based on the solution at: https://stackoverflow.com/a/17454840 Frink internally has classes that will allow copying from an InputStream to an OutputStream which will simplify this code in the future. */ FTPUpload[urlString, filename] := { url = newJava["java.net.URL", urlString] conn = url.openConnection[] outputStream = conn.getOutputStream[] inputStream = newJava["java.io.FileInputStream", filename] copyStream[inputStream, outputStream] } // Example of creating a URL to upload to (you'll want to change this) username = URLEncode["myusername", "UTF-8"] password = URLEncode["mypassword", "UTF-8"] hostname = "ftp.whereever.com" localFilename = "FTPUpload.frink" // Uploading self targetFilename = localFilename // Use same remote filename in root of server FTPUpload["ftp://$username:$password@$hostname/$targetFilename", localFilename]