Difference between binary and ASCII in FTP transmission mode

Source: Internet
Author: User
Tags ultraedit

Net: FTP is used to download files from the FTP server. It is found that some files have different sizes after being downloaded, which may be caused by ASCII transmission.

Check the differences between the two FTP transmission modes:

The difference between the ASCII mode and the binary mode is that the carriage return line breaks are processed, while the binary mode does not process any data. The ASCI mode converts the carriage return line breaks to the local carriage return characters, for example
UNIX is/N, Windows is/R/N, and Mac is/R

Files are converted in ASCII mode.
It cannot be said that different systems have different line breaks for carriage return.
Different systems have different row Terminators.
The UNIX system downstream Terminator is a byte, that is, the hexadecimal 0a.
The MS system has two bytes, namely, the hexadecimal 0d0a.
Therefore, when you download files (whether binary or text files) from the unix ftp server in ASCII mode

If the byte is 0a, A 0d will be automatically inserted. Therefore, if your file is a binary file, such as an executable file or a compressed package

It cannot be used. If your file is a UNIX text file, you are correct in ASCII mode. If binary mode is misused,

On Windows, you can see that there is no line break in this file, which contains black boxes.
In general, we 'd better use the binary method to avoid errors. If there is a text format conversion problem, that is, the Unix format

The conversion between the text in the DOS format,

Therefore, you can adopt the following habits:
All ftp transfers use the binary method, but files edited under windows must be converted to the Unix mode in advance.
The Conversion Function of ultraedit can also be saved as the Unix Terminators-lf format under ultraedit.

For the original article, see:
Http://blog.chinaunix.net/u1/56521/showart_1183437.html
Baidu Encyclopedia: ftp
Http://baike.baidu.com/view/369.htm

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.