cURL / Mailing Lists / curl-users / Single Mail


RE: Question with binary transferts

From: <>
Date: Mon, 14 May 2001 14:16:09 +0200

> Hi,
> I'm new to this mailing list. I just began using curl (v
> 652). I tried to
> upload on a ftp server with this command line but the upload
> appears to be
> in ascii mode. How can I force the binary mode?
> And same thing with download from a ftp server. I use the
> fllowing command:
> curl652 -u l:p -c -o local_file ftp://DISTANT_server_file
> When I do this, is the transfert in binary mode? If not, how
> to tranfer a
> file in binary mode?

Have you tried a new one yet? (there have been some issues with ascii/binary
that version.)

> And another thing, the files I've already downloaded are very
> big and I'd
> like to try not to download them again. Is there a way to
> convert the file
> to appear the samed way as if I'd used the binary transfer mode?

what happens with ascii mode is:

for UNIX: every \n (line feed) is replaced by \r\n (Carriage Return & Linefeed)
                on transmit & receive.

for DOS: nothing done, (line ends are allready \r\n)

for WINNT: the same.

for VMS: depending on the fileformat used
                if the files are non-'stream lf' that \r\n is appended to
                        each line, on transmit (records are remembered by line
size then,
                        the file layout is recorded in the header)
                with 'stream lf' files it's the same as with UNIX.

for TANDEM: ascii is a bit like VMS, but the on disk structure is radically

to answer the question: where does it come from and where does it go to.
Allways: is something is send binary and received ascii or send ascii & recieved
        data get screwed see above for how.
Send binaries in ascii mode might also get screwed. (depending on the precense
of \r,\n and or \r\n-pairs in the stream and depending on how the handling of
these characters is done:
kill any \r in the stream or
kill any character before \n or
check for \r\n pairs and then remove the \r...

UNIX <-> UNIX binary & text layout are the same. There is only the transfer
if you allways use binary for unix -> unix transfer there should be no problems.

DOS/WIN <-> DOS/WIN internaly the same. (Using binary for text files from
a likewise system will work)

VMS <-> VMS well YMMV (part of the filestructure is recorded in the file
heading, which
can be sent using private VMS FTP Server commands. Using VMS FTP Client/Server a
 transfer method (Image) vs. Binary&ASCII is used, then the file header&data are
both sent.).

TANDEM <-> TANDEM YMMV (depends on existing files)
> Thanks
> Fred
Nico Baggus

The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
Received on 2001-05-14