Back to product page

Site event


Fires when user wants to execute site specific command.

Syntax

  • Basic
Private Sub object_Site(User, Command, Action)
The Site(object,User,Command,Action) syntax has these parts:
objectAn expression evaluating to an object of type wodFTPD.
UserA FtpUser object. Reference to user who issued SITE command.
CommandA String value. Contains parameters used with SITE command.
ActionA FtpActions enumeration, as described in settings. When set to Deny/SilentDeny, wodFTPServer denies this action.

Remarks

Site event is fired when user enters SITE cmd command. SITE command typically is used for implementing various non-standard commands on FTP servers. wodFTPServer allows you to implement such commands through this event.

If you accept the Command, you should set Action = Allow and return 214 response. If you set Action = Deny, then wodFTPServer will return an error to the client.

Usage sample for implementing SITE HELP command would be like this:
 
Private Sub wodFTPD_Site(ByVal User As wodFTPDComLib.IFtpUser, ByVal Command As String, Action As wodFTPDComLib.FtpActions)
     Dim a As String
     If Command = "HELP" Then
           a = "The following SITE extensions are recognized:" & vbCrLf
           a = a & "RATIO -- show all ratios in effect" & vbCrLf
           a = a & "The following SITE commands are recognized (* =>'s unimplemented)." & vbCrLf
           a = a & "HELP CHMOD" & vbCrLf
           a = a & "Direct comments to root@" & wodFTPD.MyHostname & "." & vbCrLf
           User.Send 214, a
           Action = Allow
     Else
           Action = Deny
     End If
End Sub
 



The settings for Action are
Constant Value Description
Deny0 Deny execution of the action.
Allow 1 Allow to execute action.
SilentDeny2 Silently deny execution of the action.
SilentAllow 3 Silently allow to execute action.

Platforms

Windows