HP-UX System Administrator's Guide: Configuration Management
2. Determine whether the file you are trying to transfer is an ASCII (text) file or a
binary (non-ASCII) file and set the transfer mode accordingly:
a. For ASCII files, set the transfer mode using FTP’s ascii command:
ftp> ascii
This enables character conversions such as end-of-line carriage return stripping
to occur.
b. For binary files (graphics files, sound files, data base 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 stripping will not
occur.
3. Transfer the file using FTP’s get command.
Example 5-1 Retrieve an ASCII File with FTP
To retrieve the ASCII file phone.dat (located in the subdirectory called data,
under the ftp-root directory) from the PC:
ftp>cd data
ftp>ascii
ftp>get phone.dat
Example 5-2 Retrieve a Binary File with FTP
To then retrieve the graphics file net2.jpg from the subdirectory called pics
(located under the ftp-root directory):
ftp>cd ../pics
ftp>binary
ftp>get net2.jpg
On the HP-UX System: Sending a File to the PC
Once you have made a connection and logged in to the PC from your HP-UX system
(See “Establishing an FTP Connection from HP-UX to a PC” (page 91)), you are ready
to transfer a file to the PC.
96 Configuring Networking