TNG site administrators must occasionally move computer files from their PC to their web server, or vice versa, whether to install their sites, install TNG modifications, upload images, or download backups. Essentially all hosting providers provide a web-based "File Manager" tool that is handy for copying individual files. But such File Managers are limited to copying one file at a time. When you need to copy many files at a time, you need FTP.
What is FTP?
The letters "FTP" stand for "File Transfer Protocol", which, like HTTP (HyperText Transfer Protocol, used for web pages) is a standard Internet protocol that governs the way information is transferred across the Internet. HTTP is used to transfer the various components of web pages such as the source HTML document, image files, style sheet files, and so on. HTTP clients (more commonly called Web Browsers) then assemble those components and display them as web pages.
FTP is a more general protocol that transfers any kind of file (including HTML documents and images) between a client (typically a PC) and a server, and stores it on the other side of the transfer as just a file, with the same name that it had to start with.
FTP Clients and Servers
Note that the term "web server" has two distinct meanings. We usually think of a "web server" as a computer that runs one or more web sites. But the software that runs on a web server and makes web pages available to users is also called a "web server". On PC's, we run software called a "web browser" that acts as a client to a web server. Web browsers have names like "Internet Explorer", "Firefox", and "Safari".
Essentially all Web servers - and certainly all web servers that host TNG sites - have associated FTP servers that can be used to copy files to and from the web server.When we talk about an "FTP Server", we are usually talking about FTP software that runs on a server computer (probably the same computer as the web server) and allows users to transfer files between a PC and the server.
FTP clients (that is, FTP programs that run on PC's) often have the letters "FTP" in their name (e.g. CuteFTP and WS_FTP), though one of the most popular free FTP clients is called "Filezilla". (Filezilla is available for both Windows PC's and Macintosh PC's. See the Filezilla wiki page.) FTP clients can also be built into web browsers. The most popular of those FTP clients is the Firefox plugin called "FireFTP". (See http://en.flossmanuals.net/firefox/ch028_fireftp/ ) The article you are reading uses FireFTP screenshots for a couple of examples, but is intended to be about FTP in general, not specifically about FireFTP.
FTP as a verb
When you use HTTP, you are said to be "browsing" the World Wide Web or "visiting" a web site. However, when you use FTP, you are said to be "FTPing" files from one computer to another.
What you have to know to use FTP
First, you must have an FTP account. Your web hosting provider may create an FTP account for you, and assign a username and password. Usually (but not always), the FTP server corresponding to www.anysite.com is ftp.anysite.com.
But many web hosting providers only tell you about your file manager (or the site management package, such as CPanel, that includes the file manager), and you must create your own FTP accounts.
Second, you have to know how your FTP path relates to your Web path, or more particularly, how any particular file on the web server computer can be accessed on your web site. (You need to know this to use your File Manager, too.)
When you are browsing the web, you specify a web address, and view a web page. A web address often includes a filename and path specification that indicates where the web page is relative to the web site home page, but people browsing the web don't really need to know about the filename and path with the web address; they just think of the whose thing as a web address.
When you are using FTP, it is critical that you be aware of where you are within the PC file system, and within the server's file system, since you are copying specific files from a specific place on one computer to a specific place on another computer.
Note that the home directory of your FTP account is usually "above" the home directory of your Web site, so that you can manage files (such as databases, configuration files, and log files) that are not accessible through your web server.
The "two sides" concept
When you copy files from one place to another on a PC (whether a Windows PC or a Macintosh), you typically use two copies of Windows Explorer or the Mac's Finder and drag files or folders from one copy to the other. FTP programs typically have two panels to start with - a left side representing the PC, and a right side representing a server, and you either drag files and folders from one side to the other, or highlight a file or folder, and click an arrow key to move that file or folder to the other side.
FTP Client overview
Here's a screenshot of Firefox's FireFTP, showing the main TNG folder on the PC, and on the server. The areas above the horizontal black line are standard parts of the browser windows. The areas below the horizontal black line are specific to FireFTP.
The two areas outlined in blue represent the PC, on the left, and the server, on the right.
The areas outlined in red are:
- The web address that is automatically generated when you select FireFTP and a specific FTP profile (more on that later).
- The FTP profile you have selected. Each FTP site you can connect to is specified not by a specific address (as with web pages), but by a "profile" that has several parameters.
- The path to the folder currently being displayed. On the PC side, this is the full path to the current folder. On the server side, this is the subpath relative to the servers FTP root. (More on that later).
- A graphical view of the file system - much like the one displayed by Windows Explorer or the Mac's Finder.
- A list of files and folders in the current folder.
This screenshot doesn't show any files; just some folders. Note that the server has folders named "archive" and "classes" that are not present on the PC, and the PC has a folder named "gedcom" that is not present on the server.
Transferring a File or Folder
To copy a file from one side to the other, you simply click on a file to select it, and then click on the left or right arrow in the middle. You can also select folders or multiple files and folders before clicking on the arrow.
In most FTP programs, you can also just double click on a file or folder to transfer it, though some FTP programs will display the file when you double-click on it.
Deleting a File or Folder
With this FTP program, to delete a file or folder, you right-click on that file or folder, and select "Delete" from the context menu. Some FTP programs have a "Delete" button (maybe just a stylized X) that you can click on after selecting a file or folder.
Creating a Folder
Much like Windows Explorer, you must right-click on a blank space in the folder area. Then, on the content menu, select "Create Directory". (Note that FireFTP is using Unix terminology here, where folders are called "directories".)
Setting up an FTP Profile
In almost all FTP clients, you must specify several attributes before you can connect to a server. The notes below are specific to FireFTP, but almost every FTP client will have very similar configuration screens.
With FireFTP, you must click on the button where the current profile is shown (area 2 in the illustration above), and select "Create an Account". The phrase "Create an Account" is really a misnomer, for you are NOT creating an FTP account; you are simply specifying how you will connect to an existing FTP account. FireFTP will then pop up a multi-tab window where you can specify the necessary profile attributes. These two partial screenshots represent the "Main" and "Connection" tabs of the profile window:
On the "Main" tab, you must specify an "Account name" (i.e. a name for this profile), and the FTP server that this profile will connect to. You must also specify an FTP login name, and you may specify a password. (See more on the FTP server name and account name below.)
On the "Connection" Tab, you may specify the "Initial Directories" (i.e. default folders) for the PC and for the server. It is common for the "Local" folder to be the specific folder where your TNG files are stored on your PC. On the remote side, it is common to
- Leave the folder name blank, and default to your FTP account's default folder, which is typically either the root of your web site, or the folder just above that.
- or specify the folder that is the root of your website. That folder is typically named "www" or "public_html", or something like that. In any case, when your hosting account is set up, your ISP should tell you what that folder name is.
Note the checkbox on the Connection tab called "keep directories in sync while navigating". This causes FireFTP to move both sides to, say, the "extensions" folder when you click on either the PC "extensions" folder or the server's "extensions" folder. It does NOT keep the files in sync between the server and the client; it just tries makes sure that you are looking at corresponding folders on both sides.
In FileZilla, you select the File, Site Manager screen to define the FTP access to your web site
If your host supports encryption, then you should setup to use Require FTP over Explicit TLS
If you want to preserve the date timestamp of the original file in FileZilla, you need to set the Transfer, Preserve Timestamp on transferred files in the main menu.