Interesting CMD Telnet example

Source: Internet
Author: User
Tags ftp protocol

The following is a sharing by a netizen. It is very interesting to find that the CMD Telnet operation is used here. Here, we can remotely transfer some network operations to others. What are the specific problems? Let's take a look. Introduction: a netizen sent me a short message a few days ago and asked how to implement FTP breakpoint upload! At the beginning, I was very eager to compile the code. The more I edited the code, the more I suddenly realized that this was not necessary! It will be okay to show him via Telnet!

The FTP protocol does not need to be introduced. The APPE command is used for resumable upload (see the appendix for FTP instructions ).

Principle:

1. log on to the FTP server first.

2. Obtain the remote file SIZE (LIST or SIZE ).

3. When using the APPE command, it must be noted that APPE is directly resolved to the STOR command by the server on some servers, so the breakpoint mentioned here cannot be used.) Specify the file for resumable upload.

4. The client reads the data after the breakpoint Based on the Server File Size and sends it to the server.

5. exit after the data is sent.

Example:

FTP service: Serv-u ftp Server v6.3

Local file: 1.TXT

Content: "I am ZFIVE5"

Remote File: 1.TXT

Content: "I am"

CMD Telnet 127.0.0.1 21

S: 220 Serv-u ftp Server v6.3 for WinSock ready.

C: USER

S: 331 User name okay, need password.

C: PASS

S: 230 User logged in, proceed.

C: SIZE 1.TXT

S: 213 5

C: PASV

S: 227 Entering Passive Mode (, 0)

CMD Telnet 127.0.0.1 2895

C: APPE 1.TXT

S: 150 Opening ASCII mode data connection for 1. TXT.

C: ZFIVE5

CLOSE Windows

S: 226 Transfer complete.

C: QUIT

S: 221 Goodbye!

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.