Back to product page

GetDataAt method


Retrieves the contents of part of the remote file to a string variable.

Type

None

Syntax

  • Basic
object.GetDataAt RemoteFile, RemotePosLo, RemotePosHi, Size
The GetDataAt(object,RemoteFile,RemotePosLo,RemotePosHi,Size) syntax has these parts:
objectAn expression evaluating to an object of type wodSFTP.
RemoteFileA Variant value. Full path to file on the 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, defaults to -1 (all remaining data).

Remarks

Unlike the GetFileAt method, that copies part of the file from the remote server to a local file, GetDataAt will get part of the file from the server and copy it to the String variable. Once everything is completed and the Done event is fired (as for all other methods), the ListItem property will hold the retrieved data.

The GetDataAt method will try to create a temporary file on your local disk, so please ensure that wodSFTP has sufficient privileges to do this. In ASP (and other similar environments), wodSFTP usually runs as the Guest user, which may not have sufficient privileges to perform this operation. In this case it will fail with an error (Could not create temporary file).

If the size of the remote file is smaller than the Size argument, an amount of data equal to the size of the file will be returned. If more data exists in the remote file, you can call GetDataAt again to retrieve another part of the file. To get the size of a remote file, you can use the GetAttributes method.

Platforms

Windows