Skip to content

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.

ConstantDescription
OnNewConnectionTriggered immediately when a new incoming connection arrives (before accepting it)
BeforeSendSoftwareIDTriggered 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
OnShieldStrikeTriggered when the Shield records a strike against an address (see Shield events)
OnShieldBanTriggered when the Shield bans an address or a network (see Shield events)
OnShieldBanHitTriggered when a banned address tries to connect again, at most once per address per minute
OnAuthRequestTriggered when a user requests to initiate the authentication phase
OnAuthRequestAllowedTriggered if the server decided to allow the user to attempt authentication
OnAuthRequestDeniedTriggered if the server decided to deny the user's authentication request
OnAuthPasswordTriggered when a user attempts password authentication
OnAuthPKITriggered when a user attempts PKI authentication (SSH-2 only)
OnAuthInteractiveSetQuestionsTriggered before a user attempts keyboard-interactive authentication (to set the questions)
OnAuthInteractiveTriggered when a user attempts keyboard-interactive authentication (common in SSH-2)
OnAuthFailTriggered when a user fails an authentication attempt
OnAuthSuccessTriggered when a user has successfully authenticated
BeforeOpenSFTPTriggered when an SSH-2 client requests to open the SFTP subsystem
BeforeOpenShellTriggered 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
BeforeOpenCmdTriggered when an SSH-2 client requests to open a command pipeline
BeforeOpenClientFwdNever fires: the server refuses SSH port forwarding. Kept so that existing handlers stay valid
BeforeOpenServerFwdNever fires: the server refuses SSH port forwarding. Kept so that existing handlers stay valid
BeforeMakeDirTriggered before a directory is created
BeforeListDirTriggered before the list of a directory is retrieved from the VFS
BeforeSendDirListToClientTriggered after the list of a directory is retrieved from the VFS but before such list is sent to the client
BeforeDeleteDirTriggered before a directory is deleted
BeforeRenameDirTriggered before a directory is renamed
BeforeDeleteFileTriggered before a file is deleted
BeforeRenameFileTriggered before a file is renamed
BeforeModifyFileTriggered 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
BeforeFileUploadTriggered before an upload begins
BeforeFileDownloadTriggered before a download begins
AfterMakeDirTriggered right after a directory is created
AfterListDirTriggered right after the list of a directory is sent to the client
AfterDeleteDirTriggered right after a directory is deleted
AfterRenameDirTriggered right after a directory is renamed
AfterDeleteFileTriggered right after a file is deleted
AfterRenameFileTriggered right after a file is renamed
AfterModifyFileTriggered right after an existing file has been modified
AfterFileUploadTriggered right after a new file has been uploaded to the server
AfterFileDownloadTriggered right after a file has been downloaded
OnUploadFailTriggered if an upload fails (only if the failure event is detectable)
OnDownloadFailTriggered if a download fails (only if the failure event is detectable)
BeforeFileCombineRequestTriggered before 2 or more files are combined within the scope of a VFS
AfterFileCombineRequestTriggered after 2 or more files are combined within the scope of a VFS
BeforeAttrChangeTriggered before a file's attributes are changed
AfterAttrChangeTriggered after a file's attributes are changed
BeforeTimeChangeTriggered before a file's timestamps are changed
AfterTimeChangeTriggered after a file's timestamps are changed
OnCheckFileExistTriggered whenever a client checks if a certain file exists on the server
OnFileSizeRequestTriggered when a client retrieves the size of a file (e.g., SIZE command in FTP protocols)
OnFileHashRequestTriggered when a client requests the hash of a file
OnAvailDiskRequestTriggered when a client requests the available space in the home VFS (not all protocols support this)
OnCustomSITECommandTriggered 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
BeforeSymlinkNever fires: the server refuses to create symbolic links. Kept so that existing handlers stay valid
AfterSymlinkNever fires: the server refuses to create symbolic links. Kept so that existing handlers stay valid
OnQuotaExceededTriggered once per upload when it is refused or stopped because a quota limit (soft/hard) is exceeded, on every protocol
OnConnectionCloseTriggered when a client disconnects
BeforeShrCreateTriggered before a shared object is created
AfterShrCreateTriggered after a shared object is created
BeforeShrAuthRequestTriggered before a shared object is accessed
OnShrAuthRequestAllowedTriggered if the server decided to allow the user to attempt authentication
OnShrAuthSuccessTriggered when a user has successfully authenticated
BeforeShrFileUploadTriggered before a file is uploaded to a shared object
AfterShrFileUploadTriggered after a file is uploaded to a shared object
BeforeShrFileDownloadTriggered before a file is downloaded from a shared object
BeforeShrZipDownloadTriggered before a zip file is downloaded from a shared object
AfterShrFileDownloadTriggered after a file is downloaded from a shared object
AfterShrZipDownloadTriggered after a zip file is downloaded from a shared object

Which protocols raise the sign in events ​

  • OnAuthFail fires 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.
  • OnAuthRequestAllowed and OnAuthRequestDenied fire for the WebClient and for shared links only.
  • OnAuthSuccess does not fire when a script accepted the sign in itself (SSH, FTP). On the WebClient a script cannot refuse a sign in from OnAuthSuccess.

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.