Back to product page
- Introduction
- Overview
- License agreement
- Getting Started
- Objects
- Enumerations
- wodSSHD
- Methods
- Properties
- Events
- Connecting
- CryptoInformation
- Disconnected
- LoginGSSAPI
- LoginPassword
- LoginPubkey
- PortBindRequest
- PortForwardConnect
- PortForwardDisconnect
- PortForwardRequest
- Received
- ServiceRequest
- ServiceStart
- SftpDeleteFile
- SftpDownloadFile
- SftpFileTransferData
- SftpListDir
- SftpListDirData
- SftpMakeDir
- SftpProgress
- SftpRemoveDir
- SftpRename
- SftpTransferComplete
- SftpUploadFile
- StateChanged
- IwodSSHDNotify
- Methods
- Connecting
- CryptoInformation
- Disconnected
- LoginGSSAPI
- LoginPassword
- LoginPubkey
- PortBindRequest
- PortForwardConnect
- PortForwardDisconnect
- PortForwardRequest
- Received
- ServiceRequest
- ServiceStart
- SftpDeleteFile
- SftpDownloadFile
- SftpFileTransferData
- SftpListDir
- SftpListDirData
- SftpMakeDir
- SftpProgress
- SftpRemoveDir
- SftpRename
- SftpTransferComplete
- SftpUploadFile
- StateChanged
- Methods
- SSHKeyPair
- SSHUser
- SSHUsers
- How to get support
- Technical information
- Fast notifications
- Error list
SftpFileTransferData method
Called during file transfer, allowing you to alter file contents.
Type
NoneSyntax
- Basic
object.SftpFileTransferData User, FileData()
The SftpFileTransferData(object,Owner,User,FileData) syntax has these parts:
The SftpFileTransferData(object,Owner,User,FileData) syntax has these parts:
object | An expression evaluating to an object of type IwodSSHDNotify. |
Owner | A wodSSHDcom object. Instance of wodSSHServer that called this notification method. |
User | A SSHUser object. Reference to user whose file data is altered. |
FileData | An array of Byte values. Actual data as byte array (SAFEARRAY(unsigned char *) for VC++ users). |
Remarks
This method is called only if you implemented IwodSSHNotify interface in your application, and wodSSHD.Notification property has received reference to instance of your implementation.SftpFileTransferData notification method is called during file transfers, allowing you to alter contents of file currently being uploaded/downloaded. It will fire only if MonitorTransfers property is set to appropriate value other than MonitorNone.
Since FileData is a byte array, file contents can be changed in size and in values - you can supply new byte array to this argument if needed. For example, following code will always destroy all values in the array, and no matter how large files user tries to upload (or download), it will always end up with zero sized file:
Private Sub IwodSSHD-Notifications_SftpFileTransferData(ByVal Owner As wodSSHDComLIB.IwodSSHDCom, ByVal User As wodSSHDComLIB.ISSHUser, FileData() As Byte)
Dim b() As Byte
DirData = b
End Sub
You should note, however, that when user uploads file, it will be created - no matter if you change the contents or not. If you intend to alter contents of file transfers, or even to disable writing them to specified file, you can use SftpUploadFile and SftpDownloadFile notifications (and their ResolvedPath argument) to redirect wodSSHServer to some temporary file.