Very basic ftp question

N

Nicola Attico

Hi,

I'm transferring a file from linux to windows
ftp server is on linux (Linux DEMO3 2.4.18-14 #1 Wed Sep 4 13:35:50
EDT 2002 i686) and I use ftp client on windows
My file is called test.txt and I put in it:


hello
world


If I transfer the file in BINARY mode on windows I get:


helloâ–¡worldâ–¡


If I transfer the file in ASCII mode I get...


helloâ–¡worldâ–¡


...exactly the same


If I understand correctly, the only purpose of ASCII transfer is to
re-
interpret the newline character depending on the platform


So I assume that ASCII transfer mode of the windows FTP client is not
working correctly


am I correct?
is it a bug?
how can I make it work?


For the moment, I'm solving the issue running the unix2dos utility on
my windows box


I hope this is the right place for this question, otherwise thanks to
redirect me


Ciao,


Nicola Attico
 
M

Marcin Domaslawski

Hi,

You probably know that end of line in Linux is different then on Windows.
If your test file was created on Linux, then on Windows it will be always
helloâ–¡worldâ–¡ ... ftp client cant change content of file by changing end of
line from Linux format to Windows.

Marcin Domaslawski


Hi,

I'm transferring a file from linux to windows
ftp server is on linux (Linux DEMO3 2.4.18-14 #1 Wed Sep 4 13:35:50
EDT 2002 i686) and I use ftp client on windows
My file is called test.txt and I put in it:


hello
world


If I transfer the file in BINARY mode on windows I get:


helloâ–¡worldâ–¡


If I transfer the file in ASCII mode I get...


helloâ–¡worldâ–¡


...exactly the same


If I understand correctly, the only purpose of ASCII transfer is to
re-
interpret the newline character depending on the platform


So I assume that ASCII transfer mode of the windows FTP client is not
working correctly


am I correct?
is it a bug?
how can I make it work?


For the moment, I'm solving the issue running the unix2dos utility on
my windows box


I hope this is the right place for this question, otherwise thanks to
redirect me


Ciao,


Nicola Attico
 
N

Nicola Attico

You probably know that end of line in Linux is different then on Windows.
If your test file was created on Linux, then on Windows it will be always
helloâ–¡worldâ–¡ ... ftp client cant change content of file by changing end of
line from Linux format to Windows.

hi Marcin,

I guessed this was what the ASCII option was there for

Am I wrong ?

Nicola Attico
 
T

Tim Slattery

Marcin Domaslawski said:
Hi,

You probably know that end of line in Linux is different then on Windows.
If your test file was created on Linux, then on Windows it will be always
hello?world? ... ftp client cant change content of file by changing end of
line from Linux format to Windows.

If OP uses ASCII mode on his Windows FTP client when he fetches the
file from the Linux machine, it should convert the End Of Line
characters. According to OP's post, that's not happening. I don't know
why that should be so.
 
M

Marcin Domaslawski

Hi,

ASCII is mode to transfer text files. Problem is caused by incomatibility of
unix/linux systems and windows.

The same thing you can notice if you will want transfer text file created on
Windows to linux e.g. in MC when you will want edit it there will be
annoying ^M on the end of lines.

Marcin Domaslawski


You probably know that end of line in Linux is different then on Windows.
If your test file was created on Linux, then on Windows it will be always
helloâ–¡worldâ–¡ ... ftp client cant change content of file by changing end of
line from Linux format to Windows.

hi Marcin,

I guessed this was what the ASCII option was there for

Am I wrong ?

Nicola Attico
 
M

Marcin Domaslawski

Hi,

You want that simple FTP client - app to transfer files to/from - should
convert files.

I can agree that optionally should be that feature, but I'm not sure if
popular commercial FTP clients do this.

Marcin Domaslawski
 
T

Tim Slattery

Marcin Domaslawski said:
Hi,

You want that simple FTP client - app to transfer files to/from - should
convert files.

I can agree that optionally should be that feature, but I'm not sure if
popular commercial FTP clients do this.

Of course they do, that's the purpose of ASCII mode. It's been part of
the FTP specification since day one.
 
N

Nicola Attico

Of course they do, that's the purpose of ASCII mode. It's been part of
the FTP specification since day one.

Tim,

I agree with you
Anyway, I have to notice that apparently it does not work at all for
the Windows standard ftp client

Anyone can clarify?

Thanks in advance,

Nicola Attico
 
M

Marcin Domaslawski

Hi,

ok you're right - I got my mistake ... I suggested myself with auto mode

need more coffee or sleeping :D

Marcin Domaslawski
 
N

Nicola Attico

Solution found on comp.os.linux.networking
It's a configuration parameter on the vsftpd.conf file
here is the explaination

# By default the server will pretend to allow ASCII mode but in fact
ignore
# the request. Turn on the below options to have the server actually
do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious
remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/
file" in
# ASCII mode.
# These ASCII options are split into upload and download because you
may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from
breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling
should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES

ciao

Nicola Attico
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top