67
3. Set the file transfer mode. FTP transmits files in two modes: ASCII and binary. Use ASCII mode to
transfer text files. Use binary mode to transfer image files.
4. Use the lcd command to display the local working directory of the FTP client. You can upload the
file or save the downloaded file in this directory.
5. Upload or download the file.
To work with the files on the FTP server:
Task Command
Remarks
Display detailed information
about a directory or file on the
FTP server.
dir [ remotefile [ localfile ] ]
The ls command displays the name of a
directory or file only, while the dir
command displays detailed information
such as the file size and creation time.
Query a directory or file on the
FTP server.
ls [ remotefile [ localfile ] ]
The ls command displays the name of a
directory or file only, while the dir
command displays detailed information
such as the file size and creation time.
Delete the specified file on the
FTP server permanently.
delete remotefile N/A
Set the file transfer mode to
ASCII.
ascii By default, ASCII mode is used.
Set the file transfer mode to
binary.
binary By default, ASCII mode is used.
Set the FTP operation mode to
passive.
passive By default, passive mode is used.
Display the local working
directory of the FTP client.
lcd N/A
Upload a file to the FTP server. put localfile [ remotefile ] N/A
Download a file from the FTP
server.
get remotefile [ localfile ] N/A
Switching to another user account
After you log in to the FTP server with one user account, you can switch to another user account to get a
different privilege without reestablishing the FTP connection. You must correctly enter the new username
and password. A wrong username or password can cause the FTP connection to disconnect.
To switch to another user account:
Task Command
Change the username after FTP login. user username [ password ]
Maintaining and troubleshooting the FTP connection