ftp and ASCII versus Binary mode

M

Mitch Gallant

I am using the ftp client (on XP Pro sp2) referred to in this discussion:
http://groups.google.com/group/micr...read/thread/e83d91bedc000224/f8fa45ec9ab01207
because FTP mode in XP with firewall doesn't support passive mode.

When I set ASCII mode, and PUT <somefile> to my webserver, and then
GET <thesamefile>
I find that the formatting is different. (CR/LF in the original file are GET as LF).
I get exactly the same GET formatted file if I PUT in ASCII mode and GET in Binary mode!

I thought ASCII mode PUT would change CR/LF for target server, but should REVERSE
the EOL sequence to get EXACTLY the original file back when I do a PUT ??

Thanks,
- Mitch
 
R

Richard G. Harper

BINARY mode should be used when GETting/PUTting files to maintain the
original formatting.

--
Richard G. Harper [MVP Shell/User] (e-mail address removed)
* PLEASE post all messages and replies in the newsgroups
* for the benefit of all. Private mail is usually not replied to.
* My website, such as it is ... http://rgharper.mvps.org/
* HELP us help YOU ... http://www.dts-l.org/goodpost.htm
 
M

Mitch Gallant

Yes I know this, but I thought the ascii mode was intended to
format the CR/LF during the transfer to target viewing on the
different platforms. e.g. a unix target would use LF ..
But then, the GET process should transform back (if the GETing platform
is a Win32 platform).
I remember this is how it worked for WSFTP, but that cmd line ftp client
doesn't seem to handle that platform conversion (for ascii mode) properly.
Comments?
- Mitch

Richard G. Harper said:
BINARY mode should be used when GETting/PUTting files to maintain the original formatting.

--
Richard G. Harper [MVP Shell/User] (e-mail address removed)
* PLEASE post all messages and replies in the newsgroups
* for the benefit of all. Private mail is usually not replied to.
* My website, such as it is ... http://rgharper.mvps.org/
* HELP us help YOU ... http://www.dts-l.org/goodpost.htm


Mitch Gallant said:
I am using the ftp client (on XP Pro sp2) referred to in this discussion:

http://groups.google.com/group/micr...read/thread/e83d91bedc000224/f8fa45ec9ab01207
because FTP mode in XP with firewall doesn't support passive mode.

When I set ASCII mode, and PUT <somefile> to my webserver, and then
GET <thesamefile>
I find that the formatting is different. (CR/LF in the original file are GET as LF).
I get exactly the same GET formatted file if I PUT in ASCII mode and GET in Binary mode!

I thought ASCII mode PUT would change CR/LF for target server, but should REVERSE
the EOL sequence to get EXACTLY the original file back when I do a PUT ??

Thanks,
- Mitch
 

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