Scripting lesson: using scripting and session info

This article shows how to use scripting, event-handling and session information from within Server! For the sake of this  example, we will only log such information in the log file, but in real-life production scenarios, you can use this info as you wish (for example you may want to send them via email to someone or even make decisions based upon them).

Let’s start by preparing the script that – as we said – will log some info in your Server!’s log file:

We save the above script with the following name/description:  “Log several client and connection info”.Then we add an event-handler to trigger the execution of the script. Since the script contain references to file-transfer-related variables ( VirtualObjectName and  ObjectName

) it seems obvious to trigger its execution upon the occurrence of a file-transfer-related event. For the sake of this example, we have chosen the 

AfterFileUpload event, which occurs every time a file is successfully uploaded by a client onto the server.


Once the event-handler is created, we simply  Save the configuration and run an FTP/SFTP client to test if it works as expected. For the sake of this example, we run FileZilla and upload one file. Right after the upload, we open the log file with a text editor, and here’s what we find inside:

Feel free to modify this example to suit your needs. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.