file or ftp



Last revision March 24, 2006

An ftp file server. Software and data archives are often established as ftp servers. Rather than logging into the server and searching the directory tree for files by name only, Web documents can describe the files and provide direct links to get the files. This hides the details of server name and file path names from the user.

Normally, when an ftp or file link to a specific file is selected, the browser will download the file to local disk, rather than displaying its contents on the screen. A preference option may control which function is invoked. The Netscape browser apparently tries to determine if the file is simply text, in which case it is displayed, or some kind of archive to be loaded onto disk, by examining the file name and looking for standard suffixes used to designate archive files, such as .tar or .Z or .hqx, etc. The actual behavior depends upon the browser and its settings.

If a directory is specified rather than a file for the filepathname field, most browsers will show you an index of the directory, with each file or subdirectory within as a separate link that you can select.

Anonymous ftp is assumed, unless a username and password are supplied as options to the hostname field, e.g.,

//user:password@hostname.domain:port/

If the username, but not password is supplied (e.g., user@hostname), then the user's browser program should prompt for the password to be used. NEVER include the password to an ordinary account in the URL. Anybody can examine the actual URL and get your password. Some special purpose accounts that run restricted programs may have "well-known" passwords that can be included within a URL.

The filepathname field is interpreted as relative to a home directory: either the anonymous ftp server home directory, if no username and password is given, or the home directory of the particular username that is specified. For example, to get the file testfile in the home directory for the user account username on pangea using ftp with a username and password, you could specify the URL as:

ftp://username@pangea.stanford.edu/testfile

Your browser should prompt you for a password.

Comments or Questions?