FTP Link (ftp://)

You can link directly to a file on an FTP server. When the user clicks on the link, the file downloads automatically using the browser’s built-in FTP functions and is saved on the user’s machine. If the document is on an anonymous FTP server (no account name and password are required), the FTP link is simple:

<a href="ftp://server/pathname">...</a>

To link to an FTP server that requires the user to log in, the format is:

<a href="ftp://user:password@server/pathname">...</a>

For security purposes, it is highly recommended that you never include both the username and password to a server within an HTML document. If you use the syntax user@server/path, the users will be prompted to enter their passwords in a dialog box.

By default, the requested file is transferred in binary format. To specify that the document should be transferred as an ASCII file, add ;type=a to the end of the URL:

<a href="ftp://user:password@server/pathname;type=a">...</a>

The variable type=d identifies the pathname as a directory and simply displays its contents in the browser window. The variable type=i specifies image or binary mode, which is the default but may also be given explicitly.

Here are some examples of FTP links:

<a href="ftp://pete@ftp.someserver.com/program.exe">...</a>
<a href="ftp://ftp.superwarehouse.com/games;type=d">...</a>

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.