The ObjectName variable contains the file name or directory name (physical path) onto which an operation will be (or has been) done. An example of ObjectName could be C:\Data\MyDocument.docx - since this path can only identify a file on a storage medium, the ObjectName variable is clearly not suitable for Virtual File Systems (VFS) other than Disk and DiskAES265.

 

The VirtualObjectName variable contains the full POSIX file name or directory name (virtual path) onto which an operation will be (or has been) done. An example of VirtualObjectName could be /Data/MyDocument.docx - as you can see, this path can identify any resource, anywhere, in any VFS type, and it is therefore preferable to use VirtualObjectName over ObjectName in any and all cases, unless specific circumstances (known only to the programmer of your scripts) apply.

 

As you can imagine, these variable is NOT always defined, it depends on the event handler that will call the script. The definition table is as follows:

 

Event Handler

The VirtualObjectName and ObjectName variables are...

when user requests PKI authentication

NOT defined

when user requests password authentication

NOT defined

when user requests keyboard-interactive authentication

NOT defined

after a successful authentication

NOT defined

after a failed authentication

NOT defined

before opening the SFTP subsystem

NOT defined

before/after creating a directory

defined: it contains the name of the directory that the user wants to create

before/after listing a directory

defined: it contains the name of the directory that the user wants to list

before/after renaming a directory

defined: it contains the name of the directory that the user wants to rename

before/after deleting a directory

defined: it contains the name of the directory that the user wants to delete

before/after starting the upload of a file

defined: it contains the name of the file that the user wants to upload

before/after starting the download of a file

defined: it contains the name of the file that the user wants to download

before opening a file for both upload and download

defined: it contains the name of the file that the user wants to sync (perform both upload and download operations on the same file)

before/after renaming a file

defined: it contains the name of the file that the user wants to rename

before/after deleting a file

defined: it contains the name of the file that the user wants to delete

after a file has been uploaded

defined: it contains the name of the file that the user has just finished uploading

after a file has been downloaded

defined: it contains the name of the file that the user has just finished downloading

when the FTP(S)/SFTP subsystem is being closed

NOT defined

before opening a shell

NOT defined

before running a command

NOT defined

before opening a client forwarding channel

NOT defined

before opening a server forwarding channel

NOT defined

before sending server ID to client

NOT defined