You can configure a Post Transfer Action to perform actions on files successfully uploaded to the Transfer Site server.
To add or edit Post Transfer Actions, you must be a member of a group with the
role enabled.After an Action is created, it will run only on Transfer Sites that have added it as an action. To add an action to a Transfer Site, you must have the
role enabled; you do not need the role to add an existing action.Before you begin
To define a Post Transfer Action
On the
tab, click .For
, specify a descriptive name to identify this action.For supported tokens (enclosed in dollar signs). Tokens are replaced by actual values when the Action runs. Use spaces to separate multiple arguments.Use double quotation marks around any argument that might include spaces in the returned value.
, specify an executable command or the full path and name of an executable file on the Transfer Site file server followed by command arguments. After the command include any arguments to be passed to the specified program. Arguments can includeFor examples, see the Sample Post Transfer Action Commands that follow.
Click
.NOTE:
If no path information is included, command output is created in the SSH login directory of the user whose server settings of the Transfer Site file server.
is configured for authentication in theIf full path information is included, the destination directory must exist, and the user account specified in the file server settings must be able to write to this directory.
Use these examples as models for testing and configuring Post Transfer Actions. Samples include appropriate syntax for both Windows and UNIX SFTP servers.
Example 1: Save token values to a file in the upload directory
This example uses the operating system echo command to append the name of the uploaded file and the date of transfer to the contents of a file called tokenvalue.txt. (The file is created if it does not exist.) The token $FILE_PATH$ is used to create this file in the upload directory. Because this destination directory might include spaces, the token is enclosed in double quotation marks.
Windows SFTP server
cmd /c echo $FILENAME$: $DATE$ >> "$FILE_PATH$\tokenvalue.txt"
NOTE:On Windows servers, precede DOS commands with cmd /c. The /c switch is required; it specifies that cmd should exit after the specified command is carried out.
UNIX SFTP server
echo $FILENAME$: $DATE$ >> "$FILE_PATH$/tokenvalue.txt"
Example 2: Rename an uploaded file
This example renames the uploaded file by adding the name of the user who uploaded it to the filename. The $FULL_PATH$ token identifies the full path and name of the uploaded file.
Windows SFTP server
cmd /c rename "$FULL_PATH$" "$FILENAME$".$INITIATOR_USERID$
UNIX SFTP server
mv "$FULL_PATH$" "$FULL_PATH$".$INITIATOR_USERID$