8.2. Connecting events to commands

When some events occurs (dir creation, upload, etc), the server sends an event which can be connected to a command.

If the command needs arguments you just have to specify them after the command. You can use cookies in the arguments, they will be replaced as usual.

cscript = POSTUPLOAD /path/to/my/zipscript.sh %username

Table 8-1. Events

EventDescription
LOGINUser logged in
LOGOUTUser logged out, or timed out
MKDIRUser created a directory
RMDIRUser removed a directory
DELEUser deleted a file
PREUPLOADUser is about to upload file
POSTUPLOADUser finished an upload
PREDOWNLOADUser is about to download file
POSTDOWNLOADUser finished a download

Please note that the return code of your command or program is important: a return code of 0 means the command is successful, other codes are reserved for errors.

For example, if you return a code different from 0 for the POSTDOWNLOAD or POSTUPLOAD event, then the transfer will be denied.