Overview The 1756-EWEB and 1768-EWEB modules implement an FTP server; this service allows users to upload custom pages to the device, as well as transfer files in a backup or restore operation. Many IT professionals and other experienced network developers use FTP client software to transfer data to and from their EWEB modules; more casual users, however, are more likely to use a web browser or Windows Explorer to transfer files. Sometimes these users experience difficulties, and don t understand the behavior of their favorite browser while attempting to use FTP. The purpose of this application note is to explain the way FTP works on the EWEB, and they way the various FTP clients interact with it. FTP and the EWEB FTP (File Transfer Protocol) is a network protocol which allows two computers to exchange files. Although any network transport may be used, FTP is most commonly used over TCP/IP on the internet or a local area network. An FTP server awaits a client s connection on TCP port 21. A client connects to the server on this port, and uses this connection to transfer command data back and forth. A second connection is established between the client and server: the data connection. This connection is used to transfer file data between the client and server. Depending on the mode of the connection (active or passive), this connection may be opened either by the client or by the server. A series of commands with parameters may be sent from the client to the server. These commands are used to authenticate the client, change the modes of operation of the protocol, establish the data connection, traverse and examine the directory structure of the server, and initiate file transfers (uploads and downloads). The server exposes one or more local directories for clients to use. These directories (and the files within them) have their own security attributes, specifying who (if anyone) may access them. Depending on the authenticated user, certain actions (such as changing directories, uploading or downloading files) may not be allowed from certain locations within the directory tree, or at all. If you examine a typical data exchange on the command connection between an FTP client and server, it would probably look something like this: 220 VxWorks FTP server (VxWorks VxWorks5.5) ready. USER admin 331 Password required PASS admin 230 User logged in XPWD
257 Current directory is "/root/web/user/web/" PORT 192,168,1,123,14,27 200 Port set okay NLST 150 Opening BINARY mode data connection 226 Transfer complete TYPE I 200 Type set to I, binary mode PORT 192,168,1,123,14,28 200 Port set okay RETR foo.jpg 150 Opening BINARY mode data connection 226 Transfer complete QUIT 221 Bye...see you later In this example, the user connects to the server, logs in with a username and password (which is sent in plain text one definite weakness of the FTP protocol), prints the working directory, lists the directory contents, downloads a file called foo.jpg, and exits the FTP client. In the above example, you can also see the EWEB s home directory for FTP: /root/web/user/web. Under normal operation, all FTP access is restricted to this directory. Users are not allowed to traverse any higher in the directory tree. (Note: during backup/restore mode, this directory changes to /root/web/user, to allow the backup or restoration of system configuration files in addition to web files.) For more information about the FTP protocol, consult RFC 959 (http://www.w3.org/protocols/rfc959/) and the Wikipedia entry (http://en.wikipedia.org/wiki/file_transfer_protocol). FTP Clients Internet Explorer 6 and previous Internet Explorer 6 and earlier include a built-in FTP client. Because of the close integration with Windows Explorer, IE6 simply opens Windows Explorer to handle the FTP connection. For information about using Windows Explorer (and IE6) as an FTP client, consult the Windows Explorer section below.
Internet Explorer 7 Internet Explorer includes its own FTP client (rather than utilizing Windows Explorer linke IE6). It is not without its quirks, however. First and foremost, is its seeming inability to connect to the EWEB s FTP server: This could be caused by a blank password (which causes IE to log in anonymously, which the EWEB does not allow); to remedy this, log in as an administrative user with a non-blank password. Even if this is not true, and you are authenticating with a non-blank password, you will still see the above screen. A trace of the commands sent between the browser and the FTP server illustrate why: 220 VxWorks FTP server (VxWorks VxWorks5.5) ready. USER admin 331 Password required PASS admin 230 User logged in CWD / 550 Guest access denied. IE7 attempts to change the working directory to the root directory ( / ); this, however, is not allowed by the EWEB. To work around this, we explicitly request the directory path as part of the URL. Instead of requesting ftp://192.168.0.104/, we will request
ftp://192.168.0.104/root/web/user/web/. Now you will be able to download files and traverse the directory hierarchy; you will not, however, be able to upload files. Summary: IE7 is not recommended as an FTP client. If you do choose to use it, (a) ensure you have a non-blank password, (b) specify the full path in the address bar, and (c) you will not be able to upload. Internet Explorer 8 IE8 behaves in exactly the same way as IE7. For a description of behavior, as well as a workaround, consult Internet Explorer 7 above. Firefox Firefox works as a limited FTP client, with one quirk: if you have an empty password (such as the default administrator password), you will be prompted for credentials twice: once for username and password, and then again for just the password. After this, you will see the EWEB s FTP site and be able to navigate it and download files. You will not, however, be able to upload files. Summary: Firefox is not recommended as an FTP client, as you will not be able to upload. Safari Safari s FTP client does not work with the EWEB. First and foremost, it attempts to login using anonymous credentials, which the EWEB does not accept. Even if credentials are specified, Safari does not properly handle the directory listing response, and although everything appears to be in order, no files are displayed in the browser window. FTP on Safari is unusable. Summary: Safari is not usable as an FTP client with the EWEB. Google Chrome At first attempt, after prompting for a username and password, Chrome will seem to not be able to connect:
Examining the commands sent from the browser to the server, we see the following: 220 VxWorks FTP server (VxWorks VxWorks5.5) ready. USER Administrator 331 Password required PASS 230 User logged in CWD / 550 Guest access denied. TYPE A 200 Type set to A, ASCII mode PASV 227 Entering Passive Mode (10,88,81,73,11,21) LIST / 550 Guest access denied. 221 You could at least say goodbye. Chrome attempts to change the working directory to the root directory ( / ); this, however, is not allowed by the EWEB. To work around this, we explicitly request the directory path as part of the URL. Instead of requesting ftp://192.168.0.104/, we will request ftp://192.168.0.104/root/web/user/web/. Now you will be able to download files and traverse the directory hierarchy; you will not, however, be able to upload files.
Summary: Google Chrome is not recommended as an FTP client. If you do choose to use it, (a) specify the full path in the address bar, and (b) you will not be able to upload. Opera Opera works as a limited FTP client. You will see the EWEB s FTP site and be able to navigate it and download files. You will not, however, be able to upload files. Summary: Firefox is not recommended as an FTP client, as you will not be able to upload. Windows Explorer Windows Explorer includes the ability to work as an FTP client. It works well with the EWEB. However, there are a number of quirks of which the user should be mindful. First, Explorer will sometimes open up another connection to the same host, especially if opening a folder. Second, the connections are not necessarily closed when you close the window. Third, Explorer is incredibly slow when transferring large numbers of small files. Summary: You can use Windows Explorer (and IE6) as an FTP client, but you may experience poor performance and connection limitations. Command Line The command line ftp client works well with the EWEB. There are no known quirks; it is simply a very slow and manual process. Summary: You can use the command line FTP tool as an FTP client, but you will do a lot of typing. Other Tools We recommend using a dedicated FTP program with the EWEB s FTP server. Some FTP clients that work well are Core FTP, WS_FTP, and FileZilla.