Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when using a FTPS connection to transfer a file, what is the difference between a 'Binary mode transfer' and 'ASCII mode transfer'?

I am using a FTPS connection to send a text file [this file will contain EDI(Electronic Data Interchange) information]to a mailbox INOVIS.I have configured the system to open a FTPS connection and using the PUT command I write the file to a folder on the FTP server.

The problem is: what mode of file transfer should I use? How do I switch between modes?

Moreover which mode is the 'best-practice' to use when transferring file over FTPS connection?

If some one can provide me a small ftp script it would be helpful.

like image 771
shaleen mohan Avatar asked Dec 09 '25 13:12

shaleen mohan


1 Answers

Many of the other answers to this question are a collection of nearly correct to outright wrong information.

ASCII mode means that the file should be converted to canonical text form on the wire. Among other things this means:

  • NVT-ASCII character set. Even if the original file is in some other character set, such as ASCII, EBCDIC or UTF-8. Technically this disallows characters with the 8th bit set, but most implementations won't enforce this.
  • CRLF line endings.

EBCDIC mode means a similar set of rules, except that the data on the wire should be in EBCDIC.

LOCAL mode allows sending data with a size other than 8 bits per byte.

IMAGE (or BINARY) mode means that the data should be send without any changes. It is up to the user to ensure that the target system can understand the data once it arrives.

Among other things, this means that the recommendation to use BINARY mode to send text data will fail if one of the systems involved doesn't use a ASCII based character set.

like image 192
Darron Avatar answered Dec 12 '25 13:12

Darron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!