Description
-
Writes to remote file.
Return Type
-
None
Syntax
-
object.RemoteWrite Data, RemotePosLo,
RemotePosHi
The RemoteWrite Method syntax has these parts:
| object |
An expression
evaluating to an object of type wodSFTP. |
| Data |
Variant value. Holds data to
be written in remote file. |
| RemotePosLo |
A Long value. Low 32 bit of
position in the remote file where write occurs. |
|
RemotePosHi |
A Long value. High 32 bit of
position in the remote file where write occurs (usually 0). |
Remarks
-
The RemoteWrite method write Data to specific position in remote
file, opened with
RemoteOpen method. When data is fully written,
Done event will be
fired where you can write more data, close the file etc.. During the
transfer, Progress
event WILL NOT be fired.
Data argument can contain String or Byte Array (SAFEARRAY[VT_UI1]
in VC++).
You can, for example, write data like this:
- 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", True
sftp1.RemoteWrite "this is a test", 0, 0
sftp1.RemoteWrite "another test", 10, 0
sftp1.RemoteClose
sftp1.Disconnect
After you finish writing all the data, don't forget to call
RemoteClose. You
can not call other methods until RemoteClose is called (for example,
you cannot call PutFile).
|