Back to product page

GetFileAt method


Receives part of a file from the server.

Type

None

Syntax

  • Basic
object.GetFileAt LocalFile, RemoteFile, RemotePosLo, RemotePosHi, Size
The GetFileAt(object,LocalPath,RemoteFile,RemotePosLo,RemotePosHi,Size) syntax has these parts:
objectAn expression evaluating to an object of type wodSFTP.
LocalPathA Variant value. Full path of a file/folder on the local computer.
RemoteFileA Variant value. Full path of a file on the remote server.
RemotePosLoLong value. Low word of remote position.
RemotePosHiLong value. High word of remote position, defaults to 0.
SizeLong value. Size of data to retrieve.

Remarks

The GetFileAt method will initiate the copying of part of a file from the remote server to the local computer. During the transfer the Progress event will be fired several times, depending on your network connection speed and size of the file. When the copy is complete, the Done event will be fired.

If an error occurs during the transfer, the Done event, containing ErrorCode and a description of the error, will be fired immediately and the transfer will be aborted. If you want to continue the transfer later, or you want to try to receive the file again, initiate the GetFileAt method again (immediately or after reconnecting, depending on which error occurred).

You may not use the Resume property when GetFileAt is used. To continue reading from the remote file, specify different values for the RemotePosLo/RemotePosHi arguments.

You can call this method as many times as you like, but if you plan to receive many chunks of data, try to specify larger chunks for each operation and make less calls. This is advisable because each GetFileAt call internally opens the remote file, reads data and closes the remote file, which when repeated many times may cause a performance problem.

Platforms

Windows