Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Distinct VIT: Ftp Client: GetFileWithRestart

   Products   Downloads   Sales   Support   About us
  VIT
 



        
 
Summary

Retrieve file from server.

Syntax

Boolean GetFileWithRestart (LocalFile, RemoteFile, Marker)

RemoteFile String
LocalFile String
Marker String

Description

This method is used to allow the user to recover from a failed file transfer and to complete the file transfer from the point of failure. For this to happen, this function must be used to initiate the file transfer as well as to recover from the failure.

The GetFileWithRestart method takes a remote file name (RemoteFile), a local file name (LocalFile) and Marker as its parameters and returns a boolean. A marker is a value returned by the server to indicate a particular point in the file transfer.

If the file was successfully transferred, then the method returns True; otherwise, it returns False. The application should ensure that the method was successfully executed by checking the return value. The method also sets the LastResult property. The value of the LastResult property can be checked to determine if any error occurred.

In direct mode, a call to the GetFileWithRestart method transfers the remote file to the local file. The remote file and the local file are passed as parameters to this method. This feature allows an application to transfer complete files of any size without doing any I/O itself. The local file parameter passed must contain a fully qualified path name since there is no current local directory. . In direct mode Marker is ignored but user should set RetryCount property before calling this function. RetryCount property controls the number of times Restart command will be sent to the server in case of abnormal termination of file transfer. Default value of RetryCount is 0.

For an event based file transfer, pass an empty string as the LocalFile parameter. If Marker is not NULL, file is retrieved from this Marker position, user is required to position the local file corresponding to the marker position before calling this function. When a file is transferred through events, one or more OnReceive and OnReceiveMarker events will be fired. An OnReceive event delivers a portion of the data from the remote file to the application. An OnReceiveMarker event delivers a marker from the remote server to the application. User is required to save the current file position and the received server marker. In case user wants to restart the file transfer from the middle, user needs to position the local file to the saved file position and use GetFileWithRestart function with the corresponding server marker string.

Note:

When doing recovery in an event based transfer it is the responsibility of the application to know the corresponding byte position of the block of data immediately before the last marker was received for the local file.

Example

Result = FTPClient.GetFileWithRestart ("c:\test.exe", "test.exe", "")
If Result = False Then
MsgBox "Cannot get file from server", 64, "Sample Program"
End If



Browse FAQ

Related Products
Mail Objects

Recommended Add-On
Network Monitor,
Protocol Analyzer


Raves
"The night before I went on summer holiday we had to make some 'last minute' configuration changes to approx. 300 routers, a tedious job to do manually with telnet. We went along with MS Excel containing a list of IP-adresses to the routers, and the VIT telnet-component. One hour later the VBA-application (small is beautiful) was working, and after another hour all of our routers were updated with the new configuration. I just say a big "Thanks" to you all for a good sleep that night."
Eirik Brendholen, Ergo Integration AS

"We conducted a test session to compare the performance of similar products, and Distinct's product was better!" [more]
Dr. Shyam Sunder, Carnegie Mellon University

"Together with Distinct, we were able to offer our users an ideal soution to enabling them to connect to Yahoo! Pager, and to do so both quickly and reliably." [more]
Brian Park,
Producer of Yahoo! Pager, Yahoo! Inc.


  10/12/2008   Legal notices | PRIVACY Policy | Networking News |