Telnet implementation FTP protocol

Source: Internet
Author: User
Tags ftp protocol
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:



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.