Author:zfive5 (Zhaozidong)
email:zfive5@yahoo.com.cn
Introduction:
A few days ago csdn a netizen sent me a short message, asked how to implement FTP breakpoint upload! Just at the beginning I was very excited to edit the code, when the more the more-suddenly realize that there is no need to do so! Just give him a demo in Telnet.
FTP protocol is not introduced, breakpoint upload mainly used the AppE instructions (FTP instructions to explain the appendix).
Principle:
1. First log on to the FTP server.
2. Gets the remote file size (list or size).
3. Using the AppE directive (it is necessary to note that AppE is directly parsed by the server into the Stor command on some servers, so the breakpoint is not used here) specifies the file that requires a breakpoint to be resumed.
4. The client reads the data after the breakpoint according to the server file size and sends it to the server.
5. When you send the completed data, you can exit.
Example:
FTP Service: serv-u FTP Server v6.3
Local file: 1.TXT
Content: "I am ZFIVE5"
Remote file: 1.TXT
Content: "I am"
Copy Save
Cmd:telnet 127.0.0.1
s:220 serv-u FTP Server v6.3 for WinSock ready ...
C:user A
s:331 USER name okay, need password.
C:pass A
s:230 User logged in, proceed.
C:size 1.TXT
s:213 5
c:pasv
s:227 entering passive Mode (127,0,0,1,11,79)
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!
Screenshots: