Knowledge Base

The Basics - Uploading Files Using FTP

What is FTP, and what does an FTP client do?

FTP stands for File Transfer Protocol. It is the most widely-used protocol designed for transferring files from one machine to another. It allows you to design your site locally (i.e. on your personal computer) and upload it to our servers when it is ready, among other benefits. Most FTP clients also allow you to create directories, rename and delete files, and set file permissions.

Where can I get an FTP client?

Windows 9x/NT ships with a command-line FTP program you can access by typing ftp and hitting return from a DOS prompt. This is a text-only FTP client, so if you plan to be using FTP often, or uploading many files at once, it may be easier to use a graphical FTP client, such as one of the following FTP programs. These programs also support SFTP (Secure File Transfer Protocol), which we recommend.

» Core FTP (LE version)
» WS_FTP
» CuteFTP

For Macintosh OSX, you can either use its native SFTP program or free graphical SFTP programs such as Fugu.

Users with UNIX variants can use FTP by typing ftp at the shell prompt.

How do I use a graphical FTP client?

In most clients, a dialog box will appear after you select "Connect" (that or an equivalent option should be in the menus, most likely the "File" menu. You should give your account username, password, and server name in their fields in the box, then click the "Ok" (or equivalent) button to connect.

Here is an example screenshot of WS_FTP:

WS_FTP Screenshot

In the above screenshot, edad.pair.com is just an example. You should substitute your actual server name -- see the Server Details page.

You may also choose an initial directory. To default into your web directory, set the initial directory to: /usr/www/users/username

Once connected, the command actions are similar to those described in the command-line section of this question. However, your client will have either buttons or menu options for selecting them.

Generally, you can take action on a file by double-clicking on its file name, and enter a directory in the same manner. With some clients, right-clicking (or clicking and holding on a Macintosh) may bring up a menu with various options for dealing with that file. Your best option is to read through the help files presented by the FTP program to get a feel for its style of operating.

How do I use FTP at the command line?

First, use the command:

ftp gamma.pair.com

to make a connection to the server. Enter your account username and password when prompted. (Note: you should not literally attempt to SSH or FTP to gamma.pair.com unless that is the server your account is on. A list of servers can be found on the Server Details page.)

At this point, you are logged in to the system and can use such commands as cd :

ftp> cd public_html
250 CWD command successful.
ftp>

...and put to upload a file:

ftp> put index.html
200 PORT command successful.
150ng ASCII mode data connection for index.html.
226 Transfer complete.
ftp>

...and get :

ftp> get index.html
local: index.html remote: index.html
200 PORT command successful.
150ng ASCII mode data connection for index.html (834 bytes).
226 Transfer complete.
ftp>

Other important and useful commands include:

binary This indicates that the files being transferred are binary. This must be used to transfer image files such as GIFs and JPEGs. It should not be used for regular HTML files, however, although in most cases it will not matter. It especially matters, however, for imagemap control files and CGI scripts.

ascii This indicates that the files being transferred are text. This should be used to transfer regular HTML files and other files that are readable as normal text. The reason for the text-vs-binary distinction is that text files are stored in a slightly different format on many systems, including PCs, Macs, and Unix. When the ascii mode is enabled, the files will be translated as needed during the transfer. Failure to properly select ASCII or Binary is the most common cause of broken images and inoperative imagemaps and CGI scripts.

delete filename This is used to delete a file.

quote site chmod permission filename This complicated command is used to change the permissions on a file. The permission can only be specified as an octal number - for more information login by SSH and use the command "man chmod".


All content on this website is © Copyright 2000-2010 - All Rights Reserved
The content on this site may not be reused or republished.
Website template powered by VooWeb.com Website Templates
svadba, уж

My FTP client 'autodetects' ASCII and BINARY files. Should I use that?

The "autodetect" feature of most graphical FTP clients works by learning what file extensions (.html, for example) indicate text files, and which indicate binary files. Unless you've entered all extensions you use, this method is imperfect. In particular, if you plan on using autodetect make sure that .pl and .cgi files are recognized as text files. Text files that are uploaded in BINARY format, particularly cgi scripts and mail configuration files, may exhibit strange behavior or simply not work at all.

I uploaded a text file as BINARY and now it doesn't work right!

If possible, your best bet is to simply upload the file again in ASCII format, overwriting the previous copy. If that is not possible, and your account includes SSH access, there are two utilities on the server to correct the files.

If you created the file on a PC, SSH to the server and run "pcfix.pl filename" after changing into the directory the file is located in. If you created the file on a Macintosh, follow the same procedure, but substitute macfix.pl for pcfix.pl.

I'm getting 'Blocking Call Cancelled' or some other error!

Generally speaking, FTP errors are reported in vague terms. "Blocking Call Cancelled," for instance, is a message report by Windows 9X/NT clients that can mean most anything, although it often indicates the presence of a firewall on the client side.

As a first attempt at a solution, try changing your FTP client into "Passive" mode. The command-line command is PASV. Check the help files for more information on graphical clients.

Please provide feedback on this article.




 
Related Links
» The Basics
» Frequently Asked Questions
» E-Mail
» E-Commerce
» Promotion
» Advertising on Your Site
» Glossary
» Authoring/Development
» About Your Account
» Our Network and Servers
» Billing

» Contact Tech Support

« Knowledge Base Home


 
 
pair Networks - World Class Web Hosting Collections

All content on this website is © Copyright 2000-2010 - All Rights Reserved
The content on this site may not be reused or republished.
Website template powered by VooWeb.com Website Templates

dhhzp.com v 4_3