Problem description: Put the Excel file generated by server a to server B through FTP. Server A is a UNIX system, and server B is a Windows system. The Execution Code is as follows:
FTP-N $ IP <!
User $ {user }$ {pass}
ASC
Prompt off
LCD $ {localidr}
Put $ {filename}
Close
Bye
!
Result After a put the file to the directory of machine B, an error occurs when the file is opened on machine B. "the file may be read-only, or the location you want to access is read-only, or the server where the file is located does not respond. "When I look at the properties of the file, there is only one" regular "Page box, under normal circumstances, there should be three page boxes: "regular" "Custom" "abstract. I have not found a similar problem for a long time on the Internet.
Later, I tried to use the FTP tool such as LeapFTP to download the file. I used this tool to download the file from machine A to machine B and open the Excel file. I am wondering, why is it impossible to use a program? Later, I carefully observed the FTP tool log [Opening binary mode data connection for...] I understand that the original problem occurs in the data transmission mode. The FTP tool's transmission mode is binary mode (binary mode) and my program uses the ASC mode, change the program to binary mode and run the command again. The obtained file is normal and can be opened successfully. solve the problem.
What is the difference between binary and ASC in the file transmission mode? Next time, let's take a good look at why Excel documents cannot be transmitted in ASC mode?