LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   FTP always in binary mode (https://www.linuxquestions.org/questions/linux-newbie-8/ftp-always-in-binary-mode-852720/)

Jerry Mcguire 12-27-2010 09:43 PM

FTP always in binary mode
 
Happy Holidays!

In a DOS prompt, I would like to ftp ASCII get a file from a Linux machine. The file was created in vi, just a normal text file.

in DOS prompt:
Code:

ftp> ascii
200> Switching to ASCII mode.
ftp> get NLSO.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for NLSO.txt (679 bytes).
226 Transfer complete.
ftp: 679 bytes received in 0.02Seconds 33.95Kbytes/sec.
ftp>

No matter what files on the Linux directory I get, it always switches back to BINARY mode, which creates a single, very long line of text if open in Notepad. How can I force the transfer in ASCII?

Thanks.

lazlow 12-27-2010 09:54 PM

Quote:

cr
Toggle carriage return stripping during ascii type file
retrieval. Records are denoted by a carriage return/linefeed
sequence during ascii type file transfer. When cr is on (the
default), carriage returns are stripped from this sequence to
conform with the UNIX single linefeed record delimiter. Records
on non-UNIX remote systems may contain single linefeeds; when an
ascii type transfer is made, these linefeeds may be distin-
guished from a record delimiter only when cr is off.

From man ftp.

Jerry Mcguire 12-27-2010 10:55 PM

yeah, but my question is about ftp'ing in DOS to get a file from Linux.

cr is not available in the DOS ftp program.

Jerry Mcguire 12-27-2010 11:16 PM

Thanks lazlow, you inspired me to check the config file of the ftpd.

man vsftpd.conf:
Code:

      ascii_download_enable
              When  enabled,  ASCII  mode  data  transfers will be honoured on
              downloads.

              Default: NO

      ascii_upload_enable
              When enabled, ASCII mode data  transfers  will  be  honoured  on
              uploads.

              Default: NO

Enable them will do.


All times are GMT -5. The time now is 05:44 PM.