It's possible to execute a script, after a file has been downloaded by the client. This is useful for post-processing files after download, e.g. moving those files on the disk, passing them to a third party system or notifying someone about the change. It's also possible to pass information to the script for easier handling of the file. Each folder support to execute a script after download.
Configuring script execution after download
To configure the execution of a script after download:
- Enable the Advanced Mode.
- Click on the folder in question in the main window.
- In the right pane which opens up, please click on the Settings tab.
- To add a script, click on the directory icon
It's possible to pass variables to the script, by appending place holders at the end of the line containing the full path and the script itself. For a full list of place holders, please see the section about it below.
When specifying the script manually (not using the file system browser), please make sure you use an absolute path. Furthermore use quotation marks, when the path or the script itself contains white spaces. next to the Execute after download field to select a script from your local disc.
- Done. The specified script will now be executed after each download of a remote file.
Passing parameters to the script
As mentioned above, script execution after download supports passing variable to the script. Therefore the client offers some place holders to specify next to the full path and the script name.
Contains the full path and the filename of the downloaded file. Example:
Contains the full path to the downloaded file. Example:
Contains the root path of the folder which contains the downloaded file. Example:
Contains the name of the source devices for this file (comma-separated). Example:
Below you will find some configuration examples for script execution:
:\Program Files\Notification\notify.exe after every successful download:
To execute the batch file
received.bat and pass the filename with full path information to the script:
To start the batch file
automation.bat in a separate window and pass the filename with full path information to the script:
To apply the hidden attribute on Windows after the file has been downloaded:
To execute a file after the file has been downloaded:
To upload a file to a different system using cURL and a web form provided on the remote system:
Configuring script execution on headless clients
To configure script execution on headless clients, search for the folder name in the Client Configuration Files. There will be some entries starting with
f.<folder_id>. Different settings for one folder always start with the same folder ID. Those lines also include a line for the script execution, which has an empty value by default:
To add a script to be executed after downloaded and optionally a place holder for passing a variable to the script, please see the example below:
Please note: On Windows operating systems it's necessary to use double backslahes in path names.
Troubleshooting script execution
The client logs all successful and failed script executions to the log files, if logging has been enabled. Please check the Client Log Files for error messages if you face any problems.