MD5 error in FTP File Download

Source: Internet
Author: User
Tags ftp file ftp login

The MD5 error is different from the source file when you use ftp to download files. It took a while to find out why it was the original Transmission Mode:

Two file transfer methods are available: ASCII code and binary code. ASCII transmission is a little faster, but the file to be transferred must be an ASCII text file. Binary code can be used to transmit text and non-text. Therefore, binary code can be used to transmit all files. Enter the command ASCII and set it to ASCII. Enter the Binary command in binary format.

 

Set the file transmission mode:
Binary transmission:
Ftp> binary // convert the transmission mode
Ftp> put putty.exe
ASCII transmission:
Ftp> ASCII // convert transmission mode to ASCII mode
Ftp> put hello. txe

 

The modified C code is as follows:

 

Int get_file () </P> <p >{< br/> file * FP; <br/> fp = popen ("ftp-n", "W "); <br/> If (FP = NULL) <br/> return 1; <br/> fprintf (FP, "Open % s/n", "ipaddr "); <br/> fprintf (FP, "user % S % s/n", "username", "passwd"); <br/> // close interaction, during the download process, the message "[Y/n]" <br/> fprintf (FP, "prompt/N") is not displayed. <br/>/* binary transmission is used, <br/> it is faster to transmit text files using ASCII. <br/> however, for example *. an error may occur when the EXE file is not a text file. MD5 cannot be used either. // */<br/> fprintf (FP, "binary/N"); <br/> fprintf (FP, "Get downname savename/N"); <br/> fprintf (FP, "Bye/N"); <br/> fclose (FP); <br/> return 0; <br/>}

 

15:44:32

 

From: http://guoyueheng148.blog.163.com/blog/static/6016709120111119241132/

 

After successful FTP login, you need to use the GET command to download a single remote file.

**************************************** *****************************

Format: GetRemote-file [local-file]

Note:

Remote-FileRemote document to be copied?

Local-FileSpecifies the name to be used on the local computer? If this parameter is not specified, the document is named remote-file by default?

**************************************** ******************************

Megt can take multiple files and supports wildcards.

Format:MgetRemote-files [...]

Note:Remote-FilesSpecifies the remote document to be copied to the local computer?

When using mget, You need to select y/N for each file. If you want to download all files without interaction, you can usePromptCommand to turn off the interaction mode. Then you can.

Note: The mput and mget commands have two problems:
(1) the target file cannot be specified as a life-saving word. All files on the command line are regarded as source files.
(2) The mput and mget commands cannot upload or download directories, but can only upload or download files.

**************************************** ********************************

Prompt: [prompt] sets the interaction prompt when multiple files are transferred. Every time you run this command, you can directly switch between prompt on and prompt off. When it is in the prompt off state, use the mget and mput commands to select the validation key without the direct interaction between Y/n.

Ftp> prompt
Switch the negotiated commands (yes/no is not required for each file when using mput/mget)

Ftp> help prompt
Prompt force interactive prompting on multiple commands

Ftp> prompt
Interactive Mode Off.
Ftp> prompt
Interactive Mode on.
Ftp> prompt
Interactive Mode Off.
Ftp>

**************************************** **********************************

Set the file transmission mode:
Binary transmission:
Ftp> binary // convert the transmission mode
Ftp> put putty.exe
ASCII transmission:
Ftp> ASCII // convert transmission mode to ASCII mode
Ftp> put hello. txe
** Note: two methods are available for file transfer: ASCII code and binary code. ASCII transmission is a little faster, but the file to be transferred must be an ASCII text file. Binary code can be used to transmit text and non-text. Therefore, binary code can be used to transmit all files. Enter the command ASCII and set it to ASCII. Enter the Binary command in binary format.

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.