TCPFileServer.java implements the server to which the applet connects. It takes the port (use 5000 to work with the applet) and the name of the file. The server must be run on the web server that serves the applet to the browser.
Here's the FileClientApplet applet:
If you are accessing this web page from the book website, clicking on save will cause a "Connection refused" error to pop up in the text area. For security reasons, we are not running the TCPFileServer on the book website.