HFS: Event scripts

From rejetto wiki
Revision as of 11:57, 25 November 2011 by (talk) (Other events)
Jump to: navigation, search

Warning: this feature requires version 2.3 or above.

Event scripts are scripts that run when something happens: an event.

The syntax is very similar to the one used in templates. The name of the event is on a line, surrounded by [square brakets]. The script commands follows.


[upload completed]

Would you need to not overwrite an existing event script, you can prefix the event name with a "+" sign. Example: [+upload completed].

You can read more on the forum.

Events list

Network events

server start 
HFS was switched on, to accept connections.
server stop 
HFS was switched off, connections are accepted no more.
an HTTP request has been made, this includes browsing, icons, archives, and normal downloads.
request completed 
the request was fulfilled.
some actions may need to be taken before requests are filtered by some limiting option. In case, you should use this event.
this user has no permission to access the requested resource.
a new connection was established by a client.
a connection is ended.
a download was requested.
download completed 
a download has just finished.
upload completed 
a file has been uploaded.
upload failed 
a file has failed to be uploaded.

Naming events

You can use these events to change the name that will be given to the file that is about to be uploaded or downloaded: upload name, archive name, download name. The resulting text of these events will be used as new name for the worked file.

For event archive name the symbol %stream-size% is provided so that you can use it for actions depending the size of the generated archive.