Event-Handlers
Below you will find a list of all available event-handlers, along with a brief explanation of the event that triggers each one.
These are the conditions you can use to trigger the execution of your own SyncJS scripts within the context of a Syncplify Server! client session.
| Constant | Description |
|---|---|
OnNewConnection | Triggered immediately when a new incoming connection arrives (before accepting it) |
BeforeSendSoftwareID | Triggered right before the server identifies itself: the SSH version string, or the FTP greeting banner. A script can allow or block the connection; it cannot change what is sent |
OnShieldStrike | Triggered when the Shield records a strike against an address (see Shield events) |
OnShieldBan | Triggered when the Shield bans an address or a network (see Shield events) |
OnShieldBanHit | Triggered when a banned address tries to connect again, at most once per address per minute |
OnAuthRequest | Triggered when a user requests to initiate the authentication phase |
OnAuthRequestAllowed | Triggered if the server decided to allow the user to attempt authentication |
OnAuthRequestDenied | Triggered if the server decided to deny the user's authentication request |
OnAuthPassword | Triggered when a user attempts password authentication |
OnAuthPKI | Triggered when a user attempts PKI authentication (SSH-2 only) |
OnAuthInteractiveSetQuestions | Triggered before a user attempts keyboard-interactive authentication (to set the questions) |
OnAuthInteractive | Triggered when a user attempts keyboard-interactive authentication (common in SSH-2) |
OnAuthFail | Triggered when a user fails an authentication attempt |
OnAuthSuccess | Triggered when a user has successfully authenticated |
BeforeOpenSFTP | Triggered when an SSH-2 client requests to open the SFTP subsystem |
BeforeOpenShell | Triggered when an SSH-2 client requests to open a Shell. BeforeOpenCmd fires for a shell too, as in earlier versions; a block from either refuses the shell |
BeforeOpenCmd | Triggered when an SSH-2 client requests to open a command pipeline |
BeforeOpenClientFwd | Never fires: the server refuses SSH port forwarding. Kept so that existing handlers stay valid |
BeforeOpenServerFwd | Never fires: the server refuses SSH port forwarding. Kept so that existing handlers stay valid |
BeforeMakeDir | Triggered before a directory is created |
BeforeListDir | Triggered before the list of a directory is retrieved from the VFS |
BeforeSendDirListToClient | Triggered after the list of a directory is retrieved from the VFS but before such list is sent to the client |
BeforeDeleteDir | Triggered before a directory is deleted |
BeforeRenameDir | Triggered before a directory is renamed |
BeforeDeleteFile | Triggered before a file is deleted |
BeforeRenameFile | Triggered before a file is renamed |
BeforeModifyFile | Triggered before an existing file is modified without being truncated (e.g., data is appended to it). BeforeFileUpload fires for the same write too, as in earlier versions; a block from either refuses it |
BeforeFileUpload | Triggered before an upload begins |
BeforeFileDownload | Triggered before a download begins |
AfterMakeDir | Triggered right after a directory is created |
AfterListDir | Triggered right after the list of a directory is sent to the client |
AfterDeleteDir | Triggered right after a directory is deleted |
AfterRenameDir | Triggered right after a directory is renamed |
AfterDeleteFile | Triggered right after a file is deleted |
AfterRenameFile | Triggered right after a file is renamed |
AfterModifyFile | Triggered right after an existing file has been modified without being truncated (e.g., data appended to it, or a transfer resumed into it). Pairs with BeforeModifyFile |
AfterFileUpload | Triggered right after a file has been uploaded to the server: a new file, however the client opened it, or an existing file overwritten in full. Pairs with BeforeFileUpload |
AfterFileDownload | Triggered right after a file has been downloaded |
OnUploadFail | Triggered if an upload fails (only if the failure event is detectable) |
OnDownloadFail | Triggered if a download fails (only if the failure event is detectable) |
BeforeFileCombineRequest | Triggered before 2 or more files are combined within the scope of a VFS |
AfterFileCombineRequest | Triggered after 2 or more files are combined within the scope of a VFS |
BeforeAttrChange | Triggered before a file's attributes are changed |
AfterAttrChange | Triggered after a file's attributes are changed |
BeforeTimeChange | Triggered before a file's timestamps are changed |
AfterTimeChange | Triggered after a file's timestamps are changed |
OnCheckFileExist | Triggered whenever a client checks if a certain file exists on the server |
OnFileSizeRequest | Triggered when a client retrieves the size of a file (e.g., SIZE command in FTP protocols) |
OnFileHashRequest | Triggered when a client requests the hash of a file |
OnAvailDiskRequest | Triggered when a client requests the available space in the home VFS (not all protocols support this) |
OnCustomSITECommand | Triggered for every SITE command an FTP client sends, built in subcommands included, before the server handles it. EventCtx().SiteCommand holds the text after SITE; a block answers 550 |
BeforeSymlink | Never fires: the server refuses to create symbolic links. Kept so that existing handlers stay valid |
AfterSymlink | Never fires: the server refuses to create symbolic links. Kept so that existing handlers stay valid |
OnQuotaExceeded | Triggered once per upload when it is refused or stopped because a quota limit (soft/hard) is exceeded, on every protocol |
OnContentRejected | Triggered when a content scanner rejects a file, on upload or on download (version 8.12 and later). EventCtx() holds RelPath, ScanDirection (upload or download), ScanThreat (the name the scanner gave, often empty) and ScanServer (the scanner's name). It notifies only: the transfer is already refused, and a rejected upload also triggers OnUploadFail. See Content scanning |
OnConnectionClose | Triggered when a client disconnects |
BeforeShrCreate | Triggered before a shared object is created |
AfterShrCreate | Triggered after a shared object is created |
BeforeShrAuthRequest | Triggered before a shared object is accessed |
OnShrAuthRequestAllowed | Triggered if the server decided to allow the user to attempt authentication |
OnShrAuthSuccess | Triggered when a user has successfully authenticated |
BeforeShrFileUpload | Triggered before a file is uploaded to a shared object |
AfterShrFileUpload | Triggered after a file is uploaded to a shared object |
BeforeShrFileDownload | Triggered before a file is downloaded from a shared object |
BeforeShrZipDownload | Triggered before a zip file is downloaded from a shared object |
AfterShrFileDownload | Triggered after a file is downloaded from a shared object |
AfterShrZipDownload | Triggered after a zip file is downloaded from a shared object |
Which protocols raise the sign in events
OnAuthFailfires for a wrong password, a wrong one time code or a refused key on every protocol. On SSH and FTP it does not fire when the username does not exist, or when the account, the protocol, the authentication method or a script refuses the sign in; the WebClient fires it when the account or the protocol refuses the sign in too.OnAuthRequestAllowedandOnAuthRequestDeniedfire for the WebClient and for shared links only.OnAuthSuccessdoes not fire when a script accepted the sign in itself (SSH, FTP). On the WebClient a script cannot refuse a sign in fromOnAuthSuccess.
These events are not raised more widely on purpose: a handler on them runs synchronously, and an unknown username can be tried thousands of times a minute. The log events record these sign in outcomes on every protocol.
