Back to product page
- Introduction
- Overview
- License agreement
- Getting Started
- Objects
- Enumerations
- wodSFTP
- Methods
- Abort
- About
- AppendData
- AppendFile
- Connect
- DeleteFile
- DeleteFiles
- Disconnect
- ExtendedCmd
- GetAttributes
- GetData
- GetDataAt
- GetFile
- GetFileAt
- GetFiles
- ListAttributes
- ListDir
- ListNames
- LoopFiles
- MakeDir
- PutData
- PutDataAt
- PutFile
- PutFileAt
- PutFiles
- RealPath
- RemoteClose
- RemoteOpen
- RemoteRead
- RemoteWrite
- RemoveDir
- Rename
- SetAttributes
- SetAttributes64
- Properties
- Authentication
- Blocking
- BufferSize
- ClientName
- Compression
- Encryption
- EncryptionList
- ErrorText
- Extensions
- FingerPrint
- FIPS
- HMacList
- Hostname
- KeepAlives
- KeyExchangeList
- KeySignatureList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- MyHostname
- MyIP
- Notification
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- ServerErrorCode
- ServerErrorText
- State
- StateText
- Timeout
- Timezone
- TransferMode
- TransferRate
- TransferTime
- UseIPv6
- Version
- Events
- Methods
- IwodSFTPNotify
- SftpItem
- SftpItems
- How to get support?
- Technical information
- Fast notifications interface
- Error list
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:
The RemoteRead(object,RemotePosLo,RemotePosHi,Count,Type) syntax has these parts:
object | An expression evaluating to an object of type wodSFTP. |
RemotePosLo | A Long value. Low 32 bit of position in the remote file where read occurs. |
RemotePosHi | A Long value. High 32 bit of position in the remote file where read occurs (usually 0). |
Count | A Long value. Total number of bytes to read. |
Type | Optional. 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
You can use RemoteRead like this, to read full remote file:
Dim sftp1 As New wodSFTPCom
sftp1.HostName = "x.y.z"
sftp1.Login = "xyz"
sftp1.Password = "abc"
sftp1.Blocking = True
sftp1.Connect
sftp1.RemoteOpen "/tmp/somefile", PermRead
MsgBox sftp1.RemoteRead(0, 0, -1, vbString)
sftp1.RemoteClose
sftp1.Disconnect
Dim sftp1 As New wodSFTPCom
sftp1.HostName = "x.y.z"
sftp1.Login = "xyz"
sftp1.Password = "abc"
sftp1.Blocking = True
sftp1.Connect
sftp1.RemoteOpen "/tmp/somefile", PermRead
MsgBox sftp1.RemoteRead(0, 0, -1, vbString)
sftp1.RemoteClose
sftp1.Disconnect