Here are some example of how to transfer and rename files using basic FTP or Command Prompt. Most Command Prompt will automatically be set in ascii format for transfers. Ascii format is used to transfer text files, this would include all text files and all htm/html files. If you are sending or receiving images or other files types you will need to set your transfer mode to binary. Binary transfer mode is for all other file types, GIFs JPGs, BMPs, .doc etc. Type bin to set the transfer mode to binary.
Type asc to change back to ascii transfers.
NOTE: The default transfer mode in FTP is ASCII Text. You must set the transfer mode to binary if the file is anything other than a standard ASCII text file (i.e. .gif or .jpg files)
To rename a file that already exists in your FTP directory. In this case the file temp2 is being renamed to temp22.
|ftp> rename temp2 temp22
350 File exists, ready for destination name
250 RNTO command successful.
You can delete file using command delete.
To UPLOAD a file, type put C:\my-www\default2.htm, (Location of your file on your computer) and hit enter. This will transfer your file default2.htm from your computer: c:\my-www folder and place it in your root directory.
By default it will upload from your local machine’s user home folder to the server’s user home folder. Eg. on MAC from /Users/your_name to /var/www/vhost/your_account
To DOWNLOAD a file, type get C:\my-www\default2.htm and hit enter. This will transfer your file default2.htm from your root directory to your computer: c:\my-www folder.
When the transfer is complete type quit at the ftp> prompt.
Work on the directory
To view all the contents of your current directory you can type:
and the contents of that directory will be displayed.
You can move in and out of folders with the following commands:
to move into a folder:
and to move up one directory/folder:
Once you get to the ftp> prompt you can type help to see a list of commands available.
You can have files and folders in your root directory. You will be able to create folders in your account and store files in those folders, they will be accessible by linking to them from a file in your root directory. The following commands may be helpful:
- lcd – change local directory.
- mkdir – make directory.
- rmdir – remove directory.
- pwd – print the current working directory.
- mget mput – mget and mput allow you to move multiple files at once.