Description
-
Receives a file from the server, starting from a given position.
Return type
-
A Long value. If successful, 0 is returned, otherwise
error as specified here.
Syntax
-
long Sftp_GetFileAt(void *Sftp, char * LocalPath,
char *RemoteFile, __int64 RemotePos, long Size);
The GetFileAt function syntax has these parts:
| void
*Sftp |
Handle of the created Sftp
instance. |
| char
*LocalFile |
Full path to a filename
(or directory) on your local disk. |
| char
*RemoteFile |
Full path to a file on the
remote server. |
| __int64 RemotePos |
Position in the file
at which copying will commence. |
| long Size |
Size of the data to copy
locally. |
Remarks
-
The GetFileAt function will initiate the copy 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 the size of the file. When the copy is
complete, the Done event will be
called.
If an error occurs during the transfer, the Done event, containing the 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 with GetFileAt. To continue reading from the remote file, specify the RemotePos argument, increased by the
amount of data that you received in your previous call.
This method can only be initiated when the State property is set
to Connected. You cannot
receive a file if wodSFTP is busy doing something
else.
|