HP-UX System Administrator's Guide: Configuration Management

2. Determine whether the file you are trying to transfer to your HP-UX system is an
ASCII file or a binary (non-ASCII) file and set the transfer mode accordingly:
a. For ASCII (plain text) files, set the transfer mode using FTP’s ascii command:
ftp>ascii
This enables character conversions such as those that handle the differences
between how the ends of lines are handled between differing types of operating
systems.
b. For binary files (graphics files, sound files, database files, etc.), set the transfer
mode using FTP’s binary command:
ftp>binary
This causes FTP to use an eight-bit wide (byte) transfer rather than a seven
bit wide (character) transfer. This is very important as most non-ASCII formats
are dependent on that eighth bit of each byte! Your binary files will be corrupted
if you transfer them using ASCII mode.
TIP: If you are unsure of the format of the file you are transferring (ASCII
or binary) set the file type to binary. ASCII files will not be corrupted if
transferred in binary mode, however end-of-line character handling will not
occur.
3. Transfer the file using FTP’s send command.
Example 5-7 Send an ASCII File with FTP
To send the ASCII file phone.dat (located in the C:\office_stuff directory
on your PC) to your HP-UX system:
ftp>lcd C:\office_stuff
ftp>ascii
ftp>send phone.dat
— OR —
ftp>ascii
ftp>send C:\office_stuff\phone.dat
Example 5-8 Send a Binary File with FTP
To send the graphics file roadmap.jpg from the current working directory:
ftp>binary
ftp>send roadmap.jpg
Configuring File Transfer Protocol (FTP) 105