LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-27-2010, 09:43 PM   #1
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 157

Rep: Reputation: 19
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.
 
Old 12-27-2010, 09:54 PM   #2
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
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.
 
Old 12-27-2010, 10:55 PM   #3
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 157

Original Poster
Rep: Reputation: 19
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.
 
Old 12-27-2010, 11:16 PM   #4
Jerry Mcguire
Member
 
Registered: Jul 2009
Location: Hong Kong SAR
Distribution: RedHat, Fedora
Posts: 157

Original Poster
Rep: Reputation: 19
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a file in binary mode jetak Linux - General 4 09-11-2009 04:43 PM
How to set binary mode as default in FTP ??? montylee Linux - Newbie 2 03-30-2009 08:05 AM
FTP upload stalls in binary mode (56K dialup) dogpatch Linux - Software 0 09-06-2007 05:45 AM
how to open file in binary mode amit_pansuria Programming 4 07-31-2007 03:31 AM
perl NET::FTP binary mode lackluster Programming 5 07-18-2002 06:30 PM


All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration