The Excel file obtained from another machine via FTP cannot be opened

Source: Internet
Author: User

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?

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.