CN1622553A - Internet standard file transmission protocol based file breakpoint upload method - Google Patents

Internet standard file transmission protocol based file breakpoint upload method Download PDF

Info

Publication number
CN1622553A
CN1622553A CN 200410101648 CN200410101648A CN1622553A CN 1622553 A CN1622553 A CN 1622553A CN 200410101648 CN200410101648 CN 200410101648 CN 200410101648 A CN200410101648 A CN 200410101648A CN 1622553 A CN1622553 A CN 1622553A
Authority
CN
China
Prior art keywords
file
ftp
server
client
upload
Prior art date
Application number
CN 200410101648
Other languages
Chinese (zh)
Inventor
王伟
Original Assignee
北京北大方正电子有限公司
北京大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京北大方正电子有限公司, 北京大学 filed Critical 北京北大方正电子有限公司
Priority to CN 200410101648 priority Critical patent/CN1622553A/en
Publication of CN1622553A publication Critical patent/CN1622553A/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network-specific arrangements or communication protocols supporting networked applications
    • H04L67/06Network-specific arrangements or communication protocols supporting networked applications adapted for file transfer, e.g. file transfer protocol [FTP]

Abstract

The present invention is one kind of file break-point upload method based on standard Internet file transfer protocol (FTP), belongs to the field of the application of standard Internet FTP. The method of the present invention selects partial content in the file to be uploaded as the file header transmitted to the FTP server before closing the data connection to the server, and then re-forms the data connection with the FTP server to transmit the residual file content block to the server and add to the file in the server. Compared with available technology, the present invention can reduce greatly the loss caused by interruption and re-uploading.

Description

一种基于因特网标准文件传输协议的文件断点上载方法 Based on standard Internet file transfer protocol file uploading method breakpoint

技术领域 FIELD

本发明属于因特网标准文件传输协议应用领域,具体涉及一种基于因特网标准文件传输协议的文件断点上载方法。 The present invention belongs to the standard Internet file transfer protocol applications, particularly relates to a method of upload file on the breakpoint based on Internet standard File Transfer Protocol.

背景技术 Background technique

FTP(File Transfer Protocol)即标准文件传输协议(RFC959),是在TCP(Transmission Control Protocol,传输控制协议)/IP(InternetProtocol,因特网协议)环境中传输文件的一种公共标准协议,一般在OSI/RM(Open Systems Interconnection Reference Model,开放系统互联参考模型)的应用层实现。 FTP (File Transfer Protocol) that is the standard file transfer protocol (RFC959), in the TCP (Transmission Control Protocol, Transmission Control Protocol) / IP (InternetProtocol, Internet Protocol) environment, a kind of public standard protocol for transferring files, usually in the OSI / RM (open systems interconnection reference model, open systems interconnection reference model) application layer. FTP是目前因特网上共享文件和传输文件的最主要方法,通过FTP的应用,可以很方便地对远程文件进行访问和管理,并为网络主机之间高效可靠的传输文件提供协议支持。 FTP is the most important way to share files and transfer files on the Internet, you can easily access and remote file management via FTP applications, and provides protocol support for the efficient and reliable transmission of files between network hosts. FTP协议提供了一个名为REST的基本命令支持文件下载过程的中断后续传,但却没有提供文件上载过程中断后续传的基本命令。 FTP protocol provides a basic command post called REST support file download process is interrupted resume, but it does not provide file upload process is interrupted after resuming basic commands.

FTP协议模型是一种典型的C/S(Client-Server,客户端-服务器)结构,由一个或多个FTP客户端和一个FTP服务器构成,具体结构如图1所示。 FTP protocol model is a typical C / S (Client-Server, the client - server) structure, composed of one or more of a FTP client and FTP server, the specific structure shown in Figure 1. FTP客户端与FTP服务器之间交换文件时将会建立两种连接,一种是命令连接,另一种是数据连接。 Between the FTP client and FTP server will create two connection swap file, one is connected to the command, the other is a data connection. 命令连接是双方通讯和交流的信道,客户端发出的FTP基本命令和服务器返回的应答信息通过这个信道来传送。 Command channel is connected to both the communication and exchange, FTP server and basic commands sent by the client to return the response information transmitted through this channel. 数据连接是双方进行文件传送的信道,上载或者下载的文件数据通过该信道来传送,同时因数据连接发起方的不同又将文件传送模式分为主动模式和被动模式,主动模式是指由FTP服务器发起数据连接,被动模式是指由FTP客户端发起数据连接。 Data connections are both file transfer channels, to upload or download the file data is transmitted through the channel, while depending in turn file transfer mode data connection initiator into active mode and a passive mode, the active mode is defined by FTP server initiates a data connection, FTP passive mode is defined by the client initiates the data connection.

FTP协议提供了几十条基本命令用于FTP客户端与FTP服务器之间的控制与交互,这些基本命令包括USER、PASS、PORT、PASV、STOR、STOU、APPE、RETR、REST等等。 FTP protocol provides several basic commands for controlling the interaction between the FTP client and FTP server, including basic commands USER, PASS, PORT, PASV, STOR, STOU, APPE, RETR, REST like. FTP客户端发出的命令和FTP服务器回复的信息都在命令连接中传送,遵循请求-响应机制,其基本交互过程简述如下:(1)FTP客户端发送基本FTP控制命令到FTP服务器;(2)FTP服务器首先执行该命令,然后将命令的执行结果返回给FTP客户端;(3)FTP客户端解析服务器返回的执行结果信息,进而决定下一步的操作。 Command issued by the FTP client and FTP server information reply command are transmitted in the connection, following a request - response mechanism, the basic interaction summarized as follows: (1) FTP client sends a control command basic FTP to the FTP server; (2 ) FTP server first executes the command and returns the execution result of the command to the FTP client; (. 3) parse the FTP client server returns an execution result information, and then determine the next action.

现在广泛使用的FTP客户端所实现的文件上载过程,以被动传输模式为例,主动传输模式类似,原理是相同的,具体步骤如下:(1)FTP客户端利用套接字(Socket)和TCP/IP协议与目标FTP服务器建立命令连接;(2)FTP客户端发送FTP用户名,命令格式为USER xxxx\r\n,此处xxxx是指用户名;(3)FTP客户端发送FTP用户密码,命令格式为PASS xxxx\r\n,此处xxxx是指用户密码;(4)FTP客户端设置数据传送格式,如果以二进制格式传送文件则命令为TYPE i\r\n;(5)FTP客户端发送PASV\r\n命令,并从FTP服务器的回复中检索出服务器的IP地址和临时开放的端口号;(6)FTP客户端发送STOR xxxx\r\n命令,其中STOR后面的参数xxxx是指要在服务器上创建的文件名;(7)FTP客户端重新创建一个套接字(Socket),利用步骤(5)中FTP服务器返回的IP地址和临时端口号与服务器建立数据连接;(8)FTP客户端利用数据连接把本地文 File upload process is now widely used FTP client implemented, as an example a passive transmission mode, the transmission mode is similar to the active principle is the same, the following steps: (1) FTP client using sockets (the Socket) and TCP / IP protocol connection setup command destination FTP server; (2) FTP client sends an FTP user name, command format is uSER xxxx \ r \ n, where xxxx is a user name; (. 3) FTP client sends an FTP user password command is as PASS xxxx \ r \ n, where xxxx is a user password; (4) FTP client setting data transmission format, binary format if the file transfer command TYPE i \ r \ n; (5) FTP the client sends PASV \ r \ n order, and the reply from the FTP server to retrieve the server's IP address and the temporary open port number; (. 6) FTP client sends STOR xxxx \ r \ n order, wherein the back STOR parameters xxxx is the name refers to the file created on the server; (7) FTP client to re-create a socket (socket), using the step (5) of the FTP server returns the IP address and port number of temporary establish a data connection with the server; (8) FTP client connection using the local data packet 传送到FTP服务器上,文件传送结束后关闭此数据连接;(9)FTP客户端关闭命令连接,至此一次文件上载过程结束。 Transmitted to the FTP server, close the connection after the end of data file transfer; (. 9) close command FTP client connected to this end of the first file upload process.

图2给出了目前广泛使用的FTP客户端所实现的文件上载过程。 Figure 2 shows the file upload process is widely used FTP client achieved.

上述的目前通用的FTP文件上载方法在网络足够稳定、网速足够快和文件大小适中的情况下能够顺利完成文件上载的功能,但是如果在文件传送的过程中因为种种原因发生中断,则FTP服务器会把已经上载到服务器上的文件块当成不合法的文件删除,因此下一次无法恢复中断现场,所以就不得不重新上载整个文件。 Above the current general FTP file upload method can be completed in a sufficiently stable network, faster speed and file size moderate sufficiently successful file upload function, but if for some reason occur during the file transfer is interrupted, the FTP server It will have been uploaded on the server as a file block illegal file deletion, thus interrupting the scene next time can not be recovered, so we have to re-upload the entire file. 由于因特网的网络环境很复杂,不同用户接入因特网的速度也有快有慢,而且有时用户上载的文件很大,因此使用目前通用的FTP文件上载的方法传送过程中发生中断的可能性也就很大,但中断后又必须重新上载整个文件,因此给因特网用户带来不便,特别是在因特网环境复杂、易中断、数据传输速度慢以及传送文件巨大、传输时间长的情况下,这种不足体现得更为明显。 The possibility of interruption of the process due to the method of transmitting Internet network environment is complex, different users access the Internet speed is also fast or slow, and sometimes users upload large files, FTP file upload using the current general it's very big, but then have to interrupt re-upload the entire file, so bring down inconvenience, especially in complex Internet environment, easy to interrupt the data transmission speed and the huge transfer files, long transmission time situation to the Internet user, this reflects inadequate more dramatic.

目前没有发现任何相关文档、文献、专利、记录了本发明中描述的断点上载方法。 Did not find any currently relevant documents, literature, patents, contained recording method of the present invention is described in the breakpoint.

发明内容 SUMMARY

针对现有技术中存在的缺陷,本发明的目的是利用现有的FTP协议基本命令和特定的控制技术,实现FTP客户端在前一次文件上载过程被中断时下一次依然能从断点处继续上载的功能。 The defects in the prior art, the object of the present invention to utilize conventional FTP protocol specific control commands and basic technology, the previous FTP client file upload process is interrupted once nowadays still continue to upload from the breakpoint function.

为达到以上目的,本发明采用的技术方案是:一种基于因特网标准文件传输协议的文件断点上载方法,包括以下步骤:(1)FTP客户端利用套接字和TCP/IP协议与目标FTP服务器建立命令连接;(2)FTP客户端先后向FTP服务器发送用户名和密码,从而登录FTP服务器;(3)登录后,FTP客户端将数据传送格式设置为二进制格式;(4)FTP客户端将数据传输模式设置为被动模式,并从FTP服务器的回复信息中检索出FTP服务器的IP地址和其临时开放的用于建立数据连接的端口号;(5)FTP客户端向FTP服务器发出一个文件上载命令;(6)FTP客户端重新创建一个套接字,利用该套接字和步骤(4)中FTP服务器返回的IP地址和临时端口号与FTP服务器建立数据连接;(7)建立数据连接之后,FTP客户端先从需要上载的文件中选择部分内容作为文件头,将其传送到FTP服务器端,然后关闭该数据连接,此时服 To achieve the above object, the technical solution adopted by the invention is: A method of file upload breakpoint standard Internet file transfer protocol based, comprising the steps of: (. 1) using the FTP client sockets and TCP / IP protocols and destination FTP server establishes command connections; (2) FTP client has sent a username and password to the FTP server, thereby FTP server; (3) after login, FTP client will set the data transfer format to binary format; (. 4) FTP client data transfer mode to the passive mode, and the reply information from the FTP server FTP server retrieved IP address and temporarily open the port number used to establish a data connection; (. 5) the client sends an FTP file uploading to the FTP server command; (. 6) to re-create a FTP client socket, and a socket with which step (4) to the FTP server returns the IP address to establish a data connection and ephemeral port number FTP server; (7) after establishing a data connection , FTP client start file to upload selected as part of the file header, and transmitted to the FTP server, and then close the data connection, at this time serving 务器会认为当前文件已经正常传送结束了,因而会把该文件头作为合法文件保存在服务器端,相当于需要上载的文件在FTP服务器上留下了一个存根,为后续的文件追加和可能的断点上载打下了基础;向FTP服务器传送文件头另外一个原因是FTP基本协议不提供在FTP服务器端创建空文件的基本命令;如果传送文件头时中断,则需要重新上载该文件头,但是因为文件头很小,所以即使重新传送耗费的时间也可以忽略不计;(8)重复步骤(3)和步骤(4);(9)FTP客户端向FTP服务器发出追加上载文件的命令,此处的文件名与步骤(5)中的文件名相同;(10)FTP客户端重新创建一个套接字,利用该套接字和步骤(8)中FTP服务器返回的IP地址和临时端口号与FTP服务器之间再次建立数据连接;(11)FTP客户端将文件体分成若干个文件块,文件体是指需要上载的文件除去文件头后余下的部分 Service will consider the current file transfer has ended normally, so will the file header as legitimate files stored on the server side, which is equivalent to upload a file leaving a stub on an FTP server, follow-up and possible additional documents breakpoint upload laid the foundation; to an FTP server to transfer files head Another reason is basic FTP protocol does not provide the basic command to create an empty file on the FTP server; if interrupts while transferring the file header, you will need to re-upload the file header, but because header is small, even if the re-transmission time-consuming to be negligible; (8) repeating steps (3) and step (4); (9) FTP client issues a command to upload a file is added to the FTP server, here the same (5) the file name and the step of; (10) re-create a FTP client socket, and a socket with which step (8) to the FTP server returns the IP address and ephemeral port number and the FTP server re-establishing a data connection between; (11) FTP client files are categorized into a plurality of file blocks, the file thereof refers to upload the file header removing the remaining portion ,然后将文件块传送到服务器端并追加到已存在于FTP服务器的文件里,直至剩余内容全部分块传送完毕,然后关闭该数据连接,如果在分块追加文件体时发生中断,此时需要重新上载发生中断的文件块,但是由于损失的只是一小块文件传送的时间,因此对整个文件的影响也可以忽略;(12)FTP客户端关闭命令连接,至此一次文件上载过程结束。 And then sent to the server file blocks and appended to the existing file in the FTP server, the entire content of the remaining portion of the block until the transfer is complete, and then close the data connection, if an interruption occurs in the body when the blocking file is added, this time need upload the file again block the interruption occurred, but because of the time only a small loss of file transfer, the influence on the whole file can be ignored; (12) FTP client connection close command, to this end of the first file upload process.

更进一步,步骤(4)中FTP客户端的数据传输模式也可以设置为主动模式,其他步骤一样。 Still further, step (4) in the FTP client data transmission mode may be set to the active mode, as the other steps.

步骤(7)中所选的文件头大小为0.1k字节到1k字节,步骤(11)中对文件体进行分块时,每个文件块的大小1k字节到16k字节。 Step (7) in a size of the selected file header bytes to 1k 0.1k bytes, step (11) in the body of the file block size of each file 1k byte block of bytes to 16k.

本发明的效果在于:可以在不改变现有FTP协议的前提下在FTP客户端实现文件上载过程中的断点续传,将文件传输过程中由于中断所造成的重复上载的损失降到了最少。 Effect of the present invention is: HTTP file upload process may be implemented in the FTP client without changing the conventional premise FTP protocol, the file transfer process is repeated on the carrier loss due to the interruption caused by the minimum down.

附图说明 BRIEF DESCRIPTION

图1是FTP协议模型示意图;图2是当前普遍使用的FTP客户端文件上载实现流程图;图3是本发明所应用的FTP客户端文件上载实现流程图;图4是本发明所应用的FTP客户端中断后进行文件断点上载的实现流程图。 1 is a schematic FTP protocol model; FIG. 2 is currently widely used FTP client side file upload flowchart implemented; FIG. 3 is applied according to the present invention is to achieve a flowchart of a file upload FTP client; FIG. 4 is applied to the present invention FTP after the client breakpoint interrupt file uploaded to achieve a flow chart.

具体实施方式 Detailed ways

下面结合附图对本发明作一步的描述,以被动模式为例,主动模式类似,二者的原理是一致的:(1)FTP客户端如果运用本发明进行FTP文件上载的实施过程详细描述如下:1)FTP客户端创建本地套接字,应用TCP/IP协议与目标FTP服务器的开放端口,端口一般默认是21,也可能是别的,建立命令连接;2)FTP客户端先后发送USER xxxx\r\n和PASS xxxx\r\n命令将用户名和密码发送到FTP服务器端以登录FTP服务器,此处USER xxxx\r\n命令中的xxxx是指用户名,PASS xxxx\r\n命令中的xxxx是指用户密码;3)登录后,FTP客户端应用TYPE命令设置数据传送格式,如果以二进制格式传送文件则发出的命令为TYPE i\r\n;4)FTP客户端发送PASV\r\n命令,待FTP服务器给出回复后从回复信息中检索出FTP服务器的IP地址和其临时开放的用于建立数据连接的端口号;5)FTP客户端发送STOR xxxx\r\n命令,向FTP服务器表明要发 DRAWINGS The invention will be described step, the passive mode, for example, similar to the active mode, both of the principle is the same: (. 1) if the FTP client FTP file upload using the present invention is described in detail in the implementation process is as follows: 1) FTP client creates a local socket, open ports use TCP / IP protocol and the target FTP server, usually the default is port 21, it could be anything else, to establish command to connect; 2) FTP client has sent USER xxxx \ r \ n and the PASS xxxx \ r \ n command sends the username and password to the FTP server to an FTP server, where the uSER xxxx \ r \ n command xxxx refers to the user name, the PASS xxxx \ r \ n command the xxxx is a user password; 3) after the login, FTP client application TYPE command is provided a data transfer format command in binary format file transfer is issued for TYPE i \ r \ n; 4) FTP client sends PASV \ r \ n order to be given in the reply from the FTP server reply information retrieved IP address of the FTP server and temporarily open the port number used to establish a data connection;. 5) FTP client sends STOR xxxx \ r \ n order, FTP server to indicate that you want to send 起一次文件上载过程,STOR后面的参数xxxx是指要在服务器上创建的文件名;6)FTP客户端重新创建一个套接字,利用步骤4)中FTP服务器返回的IP地址和临时端口号用该套接字与服务器之间建立数据连接;7)FTP客户端先从需要上载的文件中取出大小为1K字节的文件头,然后将该文件头数据利用数据连接传送到FTP服务器端,然后关闭该数据连接。 Since a file upload process, the latter parameter xxxx STOR refers to the file name is created on the server;. 6) to re-create a FTP client socket, using step 4) to the FTP server returns the temporary IP address and port number the socket with the server is established between the data connection; file. 7) start FTP client to upload the size of 1K bytes extracted file header, then the header data is transmitted using a data connection to the FTP server, then close the data connection. 如果需要上载文件的实际体积小于等于1K字节则文件已经上载完毕,直接跳转到步骤13);如果文件体积大于1K字节,由于数据连接被客户端正常关闭,因此服务端就认为文件已经上载结束,所以也正常关闭了已上载到服务器上的文件部分,虽然在FTP客户端看来这个文件是不完整、不可用的,但在FTP服务器看来这个文件是完整的、合法的,相当于被上载的文件在FTP服务器上留下了一个存根,为后续的文件追加和可能的断点上载打下了基础;8)FTP客户端再次发送TYPE命令设置数据传送格式,步骤同3);9)FTP客户端再次发送PASV\T\n命令并获取到FTP服务器返回的IP地址和临时开放的端口号,步骤同4);10)FTP客户端发送APPE xxxx\r\n命令,向FTP服务器表明要发起一次文件追加上载的过程,APPE后面的参数xxxx是指文件名,该文件名与步骤5)中的文件名相同;11)FTP客户端重新 If desired the actual volume of less than or equal upload file has 1K bytes, the file upload is completed, directly jumps to step 13); if the file size is greater than 1K bytes, the data connection is normally closed since the client, the server will consider the file uploading the end, it is also part of the normal closed the file has been uploaded to the server, although the FTP client seems this file is incomplete, unavailable, but FTP server seems that the file is complete, legal, quite to be uploaded files on the FTP server leaving a stub for the subsequent file addition and possible breakpoints contained a foundation;. 8) FTP client sends TYPE command setting data transmission format again, the same procedure as 3); 9 ) FTP client sends again PASV \ T \ n command and acquires the FTP server returns the IP address and the temporary open port numbers, the same procedure as 4); 10) FTP client sends APPE xxxx \ r \ n command to the FTP server to show that the process of initiating upload a file is appended, the latter parameter xxxx refers APPE filename, the same) in the file name and the file name in step 5; 11) FTP client re 创建一个套接字,利用步骤9)中FTP服务器返回的IP地址和临时端口号用该套接字与服务器之间建立数据连接;12)FTP客户端将文件体以16K字节为单位分成若干个文件块,文件体是指需要上载的文件除去文件头余下的部分,然后将文件块利用步骤11)中建立的数据连接把数据传送到FTP服务器端,直至文件体的所有数据都传送结束,此时关闭该数据连接;13)FTP客户端关闭命令连接,至此一次文件上载过程结束。 Create a socket by step 9) to the FTP server returns the IP address and ephemeral port number to establish a data connection between the socket with the server; 12 is) FTP client file body is divided into 16K bytes file blocks, the file thereof refers to upload a file to remove header remaining portion, and the file block using the step 11) to establish a data connection to transmit data to the FTP server, until all the data files thereof are transmitting end, At this time, close the data connection; 13) FTP client connection close command, to this end of the first file upload process.

上述过程具体实现流程图参见图3。 Specific processes for implementing the above process Referring to FIG.

(2)如果FTP客户端在采用本发明进行上载文件的过程中发生中断,则可按如下方式实现文件的断点上载:1)FTP客户端创建本地套接字,应用TCP/IP协议与目标FTP服务器的开放端口,端口一般默认是21,也可能是别的,建立命令连接;2)FTP客户端先后发送USER xxxx\r\n和PASS xxxx\r\n命令将用户名和密码发送到FTP服务器端以登录FTP服务器,此处USER xxxx\r\n命令中的xxxx是指用户名,PASS xxxx\r\n命令中的xxxx是指用户密码;3)如果上一次中断发生在上载文件头的过程中,则重新传送整个文件,实现流程见图3;4)如果上一次中断发生在文件体分块追加的过程中,则FTP客户端首先向FTP服务器发送SIZE xxxx\r\n命令,此处xxxx是需要进行断点上载的文件名,然后从FTP服务器返回的信息中检索出目标文件已上载到服务器上的文件体积,假设该体积是X字节;5)FTP客户端应用TYPE命令设置数 (2) if an interruption occurs during an FTP client to the present invention uploading files, upload files breakpoint can be achieved as follows: 1) FTP client creates a local socket applications TCP / IP protocol and the target open port FTP server port usually the default is 21, it could be anything else, to establish command to connect; 2) FTP client has sent uSER xxxx \ r \ n and PASS xxxx \ r \ n command sends the user name and password to FTP server to log FTP server, where uSER xxxx \ r \ n command xxxx is a user name, PASS xxxx \ r \ n command xxxx is a user password; 3) if the last interruption occurs in uploading the file header process, the entire file is re-transmitted, to achieve process shown in Figure 3; 4) If an interrupt occurs during a file body of the additional block, the FTP client first sends SIZE xxxx \ r \ n command to the FTP server, where xxxx is the need for the file name contained in the breakpoint, and then retrieves the information from the FTP server returned by the target file has been uploaded to the file server on the volume, the volume is assumed that X bytes;. 5) FTP client application TYPE command set the number of 传送格式,如果以二进制格式传送文件则发出的命令为TYPE i\r\n;6)FTP客户端发送PASV\r\n命令,待FTP服务器给出回复后从回复信息中检索出FTP服务器的IP地址和其临时开放的用于建立数据连接的端口号;7)FTP客户端发送APPE xxxx\r\n命令,此处xxxx是需要进行断点上载的文件名,向FTP服务器表明要发起一次文件追加上载的过程;8)FTP客户端重新创建一个套接字,利用步骤6)中FTP服务器返回的IP地址和临时端口号用该套接字与服务器之间建立数据连接;9)FTP客户端把步骤4)中获得的X数值做为文件偏移值,将本地文件的文件读指针偏移到X字节处,然后以16K字节为单位继续从文件中读取数据并利用步骤8)中建立的数据连接把数据传送到FTP服务器端,直至文件的所有剩余数据都传送结束,此时关闭该数据连接;10)FTP客户端关闭命令连接,至此一次文件的断点上载过程 Transmission format, binary format if the command is issued to transfer files TYPE i \ r \ n; 6) FTP client sends PASV \ r \ n command reply from the retrieved information, the FTP server FTP server is given until replies IP address and its temporary open port number used to establish a data connection; 7) FTP client sends APPE xxxx \ r \ n command, where xxxx is the name of the file needs to be uploaded on the breakpoint, to launch a show to an FTP server uploaded file addition process;. 8) to re-create a FTP client socket, using step 6) to the FTP server returns the IP address and ephemeral port number to establish a data connection between the socket with the server;. 9) FTP client the end value of X in step 4) as obtained in the file offset value, the local file read pointer is shifted to the X bytes, 16K bytes and then continues to read the file from step 8 using ) establishing a data connection to transmit data to the FTP server, all remaining data are transmitted until the end of file, then close the data connection; 10) close command FTP client connected to this primary file upload process breakpoint 束。 Beam.

上述的文件断点上载过程流程图参见图4。 Said breakpoint file upload process flowchart of FIG. 4.

Claims (4)

1.一种基于因特网标准文件传输协议的文件断点上载方法,包括以下步骤:(1)FTP客户端利用套接字和TCP/IP协议与目标FTP服务器建立命令连接;(2)FTP客户端先后向FTP服务器发送用户名和密码,从而登录FTP服务器;(3)登录后,FTP客户端将数据传送格式设置为二进制格式;(4)FTP客户端将数据传输模式设置为被动模式,并从FTP服务器的回复信息中检索出FTP服务器的IP地址和其临时开放的用于建立数据连接的端口号;(5)FTP客户端向FTP服务器发出一个文件上载命令;(6)FTP客户端重新创建一个套接字,利用该套接字和步骤(4)中FTP服务器返回的IP地址和临时端口号与FTP服务器建立数据连接;(7)建立数据连接之后,FTP客户端先从需要上载的文件中选择部分内容作为文件头,将其传送到FTP服务器端,然后关闭该数据连接;(8)重复步骤(3)和步骤(4);(9)FTP客户端向FTP服务器发 CLAIMS 1. A method of file upload breakpoint standard Internet file transfer protocol based, comprising the steps of: (1) FTP client establishes a connection using the socket commands and TCP / IP protocol and destination FTP server; (2) FTP Client successively transmitted to the FTP server, a user name and password to log onto the FTP server; and (3) after login, FTP client to transfer data format to binary format; (. 4) FTP client data transfer mode to the passive mode, and from the FTP reply information server retrieves the IP address of the FTP server and temporarily open the port number used to establish a data connection; (. 5) FTP client issues a command to upload a file to an FTP server; (. 6) to re-create a FTP client socket, and the socket by using the step (4) to the FTP server returns the IP address and ephemeral port number to establish a data connection with an FTP server; after (7) establish a data connection, FTP client to upload files needed to start the selected as part of the file header, and transmitted to the FTP server, and then close the data connection; (8) repeating steps (3) and step (4); (9) FTP to the FTP server sends the client 追加上载文件的命令,此处的文件名与步骤(5)中的文件名相同;(10)FTP客户端重新创建一个套接字,利用该套接字和步骤(8)中FTP服务器返回的IP地址和临时端口号与FTP服务器之间再次建立数据连接;(11)FTP客户端将文件体分成若干个文件块,文件体是指需要上载的文件除去文件头后余下的部分,然后将文件块传送到服务器端并追加到已存在于FTP服务器的文件里,直至剩余内容全部分块传送完毕,然后关闭该数据连接,如果在分块追加文件体时发生中断,此时需要重新上载发生中断的文件块,但是由于损失的只是一小块文件传送的时间,因此对整个文件的影响也可以忽略;(12)FTP客户端关闭命令连接,至此一次文件上载过程结束。 Append command to upload a file, the file name and the same as in step (5) in the file name here; (10) re-create a FTP client socket, and a socket with which step (8) to the FTP server returns established between the IP address and ephemeral port number to the FTP server again data connection; (. 11) FTP client file body into a number of file blocks, the file thereof refers to upload a file header removing the remaining portion, and then the file block sent to the server and added to the existing file in the FTP server's until the remaining contents of the whole portion of the block transfer is complete, and then close the data connection, if an interruption occurs while blocking the additional file body, this case needs to be uploaded again interrupted file blocks, but because of the time only a small loss of file transfer, the influence on the whole file can be ignored; (12) FTP client connection close command, to this end of the first file upload process.
2.如权利要求1所述的一种基于因特网标准文件传输协议的文件断点上载方法,其特征是:步骤(4)中FTP客户端的数据传输模式也可以设置为主动模式,其他步骤一样。 2. one of the claims 1 breakpoints based on standard Internet file transfer protocol file uploading method, wherein: step (4) in the FTP client data transmission mode may be set to the active mode, as the other steps.
3.如权利要求1或2所述的一种基于因特网标准文件传输协议的文件断点上载方法,其特征是:步骤(7)中所选的文件头大小为0.1k字节到1k字节。 3. An claim 1 or claim 2 on a file upload method breakpoint Internet file transfer protocol based on the standard, wherein: step (7) the header size is selected to 1k 0.1k bytes byte .
4.如权利要求3所述的一种基于因特网标准文件传输协议的文件断点上载方法,其特征是:步骤(11)中对文件体进行分块时,每个文件块的大小为1k字节到16k字节。 3, one of the upload method as claimed in claim breakpoint on Internet standard document based on the file transfer protocol, wherein: step (11) in the body of the file block, the file size of each block is 1k word section to 16k bytes.
CN 200410101648 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method CN1622553A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200410101648 CN1622553A (en) 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200410101648 CN1622553A (en) 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method

Publications (1)

Publication Number Publication Date
CN1622553A true CN1622553A (en) 2005-06-01

Family

ID=34766786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200410101648 CN1622553A (en) 2004-12-20 2004-12-20 Internet standard file transmission protocol based file breakpoint upload method

Country Status (1)

Country Link
CN (1) CN1622553A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100550848C (en) 2006-12-31 2009-10-14 中国建设银行股份有限公司 Method and system for transferring large number of data
CN101951410A (en) * 2010-10-13 2011-01-19 国电南瑞科技股份有限公司 Method for automatically and remotely upgrading embedded terminal
CN102096772A (en) * 2011-01-30 2011-06-15 北京恒华伟业科技股份有限公司 Smart client system of power transmission and transformation project
CN101064910B (en) 2006-04-24 2011-08-31 上海信息安全基础设施研究中心 Call control based terminal-to-terminal breakpoint transmission method
CN102291443A (en) * 2011-08-02 2011-12-21 杭州士兰微电子股份有限公司 An embedded application-layer data network communication processing method
CN102421090A (en) * 2010-09-28 2012-04-18 上海实龙电力设备有限公司 Software updating method of wireless communication product
CN102497395A (en) * 2011-11-30 2012-06-13 北京京航计算通讯研究所 Breakpoint unloading application control method
CN102789477A (en) * 2011-05-19 2012-11-21 巴比禄股份有限公司 File managing apparatus for processing an online storage service
CN102801754A (en) * 2011-05-24 2012-11-28 英业达集团(天津)电子技术有限公司 Method and system for breakpoint transmission
CN101453478B (en) 2007-11-28 2013-07-03 新奥特(北京)视频技术有限公司 Integrity checking method in document transmission
CN103684712A (en) * 2012-09-14 2014-03-26 百度在线网络技术(北京)有限公司 Method, device and network disc for quickly resuming file transmission
CN105187509A (en) * 2015-08-13 2015-12-23 深圳市广和通无线股份有限公司 Method for uploading data of wireless communication module supporting continuous transmission
CN106254507A (en) * 2016-08-29 2016-12-21 苏州蓝海彤翔系统科技有限公司 File transmission control method and system

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064910B (en) 2006-04-24 2011-08-31 上海信息安全基础设施研究中心 Call control based terminal-to-terminal breakpoint transmission method
CN100550848C (en) 2006-12-31 2009-10-14 中国建设银行股份有限公司 Method and system for transferring large number of data
CN101453478B (en) 2007-11-28 2013-07-03 新奥特(北京)视频技术有限公司 Integrity checking method in document transmission
CN102421090A (en) * 2010-09-28 2012-04-18 上海实龙电力设备有限公司 Software updating method of wireless communication product
CN101951410A (en) * 2010-10-13 2011-01-19 国电南瑞科技股份有限公司 Method for automatically and remotely upgrading embedded terminal
CN102096772A (en) * 2011-01-30 2011-06-15 北京恒华伟业科技股份有限公司 Smart client system of power transmission and transformation project
CN102096772B (en) 2011-01-30 2012-11-21 北京恒华伟业科技股份有限公司 Smart client system of power transmission and transformation project
CN102789477A (en) * 2011-05-19 2012-11-21 巴比禄股份有限公司 File managing apparatus for processing an online storage service
CN102801754A (en) * 2011-05-24 2012-11-28 英业达集团(天津)电子技术有限公司 Method and system for breakpoint transmission
CN102291443A (en) * 2011-08-02 2011-12-21 杭州士兰微电子股份有限公司 An embedded application-layer data network communication processing method
CN102497395A (en) * 2011-11-30 2012-06-13 北京京航计算通讯研究所 Breakpoint unloading application control method
CN103684712A (en) * 2012-09-14 2014-03-26 百度在线网络技术(北京)有限公司 Method, device and network disc for quickly resuming file transmission
CN103684712B (en) * 2012-09-14 2017-04-05 百度在线网络技术(北京)有限公司 Fast file recovery retransmission method, device and network disk
CN105187509A (en) * 2015-08-13 2015-12-23 深圳市广和通无线股份有限公司 Method for uploading data of wireless communication module supporting continuous transmission
CN106254507A (en) * 2016-08-29 2016-12-21 苏州蓝海彤翔系统科技有限公司 File transmission control method and system

Similar Documents

Publication Publication Date Title
Badrinath et al. Handling mobile clients: A case for indirect interaction
US7680884B2 (en) System and implementation method of controlled multicast
US6532284B2 (en) Method and system for optimizing bandwidth cost via caching and other network transmission delaying techniques
US6941386B2 (en) Protocol processing stack for use with intelligent network interface device
JP3482091B2 (en) Communication device
US7437466B2 (en) Wire protocol for a media server system
US6226676B1 (en) Connection establishment and termination in a mixed protocol network
US7907525B2 (en) Method of communicating packet multimedia to restricted endpoints
CN1117464C (en) Wireless data transmission method and mobile terminal and mutual function device used for same
US7471681B2 (en) Determining network path transmission unit
CN1954527B (en) Networked storage devices and methods
KR100938519B1 (en) Method to synchronize and upload an offloaded network stack connection with a network stack
US7610622B2 (en) Supporting options in a communication session using a TCP cookie
US20020091831A1 (en) Internet modem streaming socket method
US20040267937A1 (en) Client to server streaming of multimedia content using HTTP
US7447775B1 (en) Methods and apparatus for supporting transmission of streaming data
KR100255501B1 (en) Improving session and transport layer proxies via tcp glue
US20020156901A1 (en) Method and system for providing a persistent HTTP tunnel
CN101627601B (en) A method and apparatus for remote access to a home network
US7206932B1 (en) Firewall-tolerant voice-over-internet-protocol (VoIP) emulating SSL or HTTP sessions embedding voice data in cookies
US20040019686A1 (en) Switching node apparatus for storage network and method of accessing remote storage apparatus
US20030167346A1 (en) Port aggregation for network connections that are offloaded to network interface devices
Maltz et al. MSOCKS: An architecture for transport layer mobility
JP3662080B2 (en) Firewall dynamic control method
CN102025593B (en) Distributed user access system and method

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C12 Rejection of an application for a patent