Back to product page
- Introduction
- Overview
- License agreement
- Getting Started
- Objects
- Enumerations
- wodFTPD
- Methods
- Properties
- Authentication
- BindIP
- BindIPType
- Certificate
- DirFormat
- Encryption
- EncryptionList
- FileLocking
- FIPS
- ForceUTF8
- GoodbyeMessage
- GreetingMessage
- HMacList
- HostKeyList
- KeyExchangeList
- MaxDataPort
- MinDataPort
- MonitorTransfers
- MyHostname
- MyIP
- Notification
- PasvPort
- Port
- Protocol
- Secure
- ServerName
- SFTPVersion
- Status
- StrictDataIP
- Threads
- Timeout
- UseIPv6
- Users
- Version
- VirtualFiles
- VirtualFolders
- Events
- wodFTPDNotify
- FtpUser
- FtpUsers
- VirtualFile
- VirtualFiles
- VirtualFolder
- VirtualFolders
- How to get support?
- Technical information
- Fast notifications interface
- Error list
FileTransferData event
Fires during file transfer, allowing you to alter file contents.
Syntax
- Basic
Private Sub object_FileTransferData(User, FileData())
The FileTransferData(object,User,FileData()) syntax has these parts:
The FileTransferData(object,User,FileData()) syntax has these parts:
object | An expression evaluating to an object of type wodFTPD. |
User | A FtpUser object. Reference to user who is listing directory contents. |
FileData() | An array of Byte values. Actual data as byte array (SAFEARRAY(unsigned char *) for VC++ users). |
Remarks
FileTransferData event is fired 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 FtpD_FileTransferData(ByVal User As wodFTPDComLib.IFtpUser, 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. To delete such files, you can use TransferComplete event. Even more, if you intend to alter contents of file transfers, or even to disable writing them to specified file, you can use UploadFile and DownloadFile events (and their ResolvedPath argument) to redirect wodFTPServer to some temporary file.