Back to product page

GetFileAt function


Aborts the current method execution.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_GetFileAt(void *Sftp, char * LocalPath, char *RemoteFile, __int64 RemotePos, long Size);
The GetFileAt(void *Sftp,char *LocalFile,char *RemoteFile,__int64 RemotePos,long Size) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *LocalFileFull path to a filename (or directory) on your local disk.
char *RemoteFileFull path to a file on the server.
__int64 RemotePosPosition in the file at which copying will commence.
long SizeSize 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.

Platforms

Windows