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!