Back to product page

RemoteRead method


Reads from remote file.

Type

A String value. Data that is read (only in Blocking mode).

Syntax

  • Basic
object.RemoteRead RemotePosLo, RemotePosLo, Count, [Type]
The RemoteRead(object,RemotePosLo,RemotePosHi,Count,Type) syntax has these parts:
objectAn expression evaluating to an object of type wodSFTP.
RemotePosLoA Long value. Low 32 bit of position in the remote file where read occurs.
RemotePosHiA Long value. High 32 bit of position in the remote file where read occurs (usually 0).
CountA Long value. Total number of bytes to read.
TypeOptional. A Variant value. Specifies type of data to return in RemoteData event (String or Byte Array)

Remarks

The RemoteRead method will read data from remote file opened with RemoteOpen method. When data is received, it will be provided to your application through RemoteData event. When receive completes, Done event will be fired, where you can call new RemoteRead, close remote file etc.. During the transfer, Progress event WILL NOT be fired.

If you specify -1 then complete file will be read from one RemoteRead method call. After you finish reading all the data, don't forget to call RemoteClose. You can not call other methods until RemoteClose is called (for example, you cannot call GetFile).

In Blocking mode, RemoteRead will return data immediately to you (so you can ignore RemoteData event).

The Type parameter should be vbString (8) which means that the returned type will be a string, otherwise it should be vbByte (17) or vbArray(8192) which means that returned data will be a byte array. Depending on your choice, you should store it in an appropriate variable.

Code sample

  • Basic

Platforms

Windows